Subject: [clisp-list] to_preload (re the package bug)

From: Peter Wood <[email-masked]>
Date: Wed Apr 10 08:23:07 2002

Hi

I discovered this in impnotes (Extensions 2.2 External Modules):

TO_PRELOAD (optional)
 The space seperated list of lisp files to load into an intermediate
 lispinit.mem before building the lsipinit.mem belonging to a new
 linking set.  This var is usually used for defining lisp packages
 which must be present when the new .c files are initialized.

May I suggest, Sam, that you explicitly state that TO_PRELOAD must be
set if the module contains a def-call-in (no longer optional), and
link to the example with def-call-in. (sort2), so that (especially
new) users who don't read clisp-list will be able to build the example.

I have tested using TO_PRELOAD and it works.

Regards,
Peter

---

From: Sam Steingold <[email-masked]>
Date: Wed Apr 10 09:29:02 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] to_preload (re the package bug)"
> * Sent on Wed, 10 Apr 2002 17:09:22 +0200
> * Honorable Peter Wood <[email-masked]> writes:
>

good!
could you please send a patch to doc/impext.xml?
(sort2 does not mention TO_PRELOAD right now!)

PS do I understand correctly that you tried my patch for [ 539701 ]
   early initialization error -> crash and it works for you?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
If your VCR is still blinking 12:00, you don't want Linux.

---

From: Peter Wood <[email-masked]>
Date: Wed Apr 10 10:45:08 2002

Hi,

> (sort2 does not mention TO_PRELOAD right now!)

I don't have any of the docbook gunk on my system, so I wouldn't be
able to test the patch.  I am not going to spend 2 hours finding,
downloading, compiling and installing, then 3 hours learning, a system
which I really dislike just to write 15 lines.

>    early initialization error -> crash and it works for you?

I got the results which I reported on the list:

http://www.geocrawler.com/lists/3/SourceForge/1124/25/8315188/

Your analysis made sense to me.

I did not do further testing than that, ymmv.

Regards,
Peter

---

From: Sam Steingold <[email-masked]>
Date: Wed Apr 10 15:23:48 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] to_preload (re the package bug)"
> * Sent on Wed, 10 Apr 2002 19:31:16 +0200

you can edit impext.xml with any text editor.
don't worry about the markup - I will fix it for you.
concentrate on the contents.

you are the only one who can do this - describe what, specifically,
should go into TO_PRELOAD in sort2.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Your mouse has moved - WinNT has to be restarted for this to take effect.

---

From: Peter Wood <[email-masked]>
Date: Wed Apr 10 19:01:31 2002

Hi,

> should go into TO_PRELOAD in sort2.

It's just the name of a lisp file which does a defpackage for the
package which you  want the module to be in.

Here's the patch.

$patch -p0 impext.xml sort2.patch

Regards,
Peter

1857a1858,1863
> 
> This variable is obligatory when the
> new module contains a 'def-call-in' form, for obscure reasons,
> internal to Clisp.  This requirement may be removed in the future.
> For an example of usage, see example 'call-in' below.
> 
2843a2850,2851
> Create a file "package.lisp" containing the form (defpackage
> "FFI-TEST" (:use "LISP" "FFI"))
2844a2853
> Add a line: TO_PRELOAD='package.lisp' in link.sh

---

From: Sam Steingold <[email-masked]>
Date: Thu Apr 11 07:23:10 2002

> * In message <[email-masked]>
> * Sent on Wed, 10 Apr 2002 22:23:27 +0200

the patch does not apply cleanly.
could you please send a unified context diff?
(put 'diff -uwb' into your ~/.cvsrc)

thanks.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
He who laughs last did not get the joke.

---

From: Peter Wood <[email-masked]>
Date: Thu Apr 11 09:44:44 2002

> (put 'diff -uwb' into your ~/.cvsrc)

Sorry.  I downloaded impext.xml and did:

diff -uwb impext.xml impext.new2.xml > newpatch.patch

I hope that fixes it.

Regards,
Peter
--- impext.xml	Thu Apr 11 18:27:25 2002
+++ impext.new2.xml	Wed Apr 10 22:11:41 2002
@@ -1855,6 +1855,12 @@
   belonging to a new &linkset;.
   This variable is usually used for defining Lisp packages which must be
   present when the new &c-file; files are initialized.
+
+This variable is obligatory when the
+new module contains a 'def-call-in' form, for obscure reasons,
+internal to Clisp.  This requirement may be removed in the future.
+For an example of usage, see example 'call-in' below.
+
  </simpara></listitem></varlistentry>
 </variablelist>
 
@@ -2841,7 +2847,10 @@
 $ cc -O -c sort1.c
 $ cd sort
 $ ln -s ../sort1.o sort1.o
+Create a file "package.lisp" containing the form (defpackage
+"FFI-TEST" (:use "LISP" "FFI"))
 Add sort1.o to NEW_LIBS and NEW_FILES in link.sh.
+Add a line: TO_PRELOAD='package.lisp' in link.sh
 $ cd ..
 $ base/lisp.run -M base/lispinit.mem -c sort2.lisp sorttest.lisp
 $ clisp-link add-module-set sort base base+sort