Subject: [clisp-list] Confused by `require', *load-paths* and clisp 2.28

From: Dave Pearson <[email-masked]>
Date: Thu Mar 14 04:59:02 2002

After upgrading clisp to 2.28 I seem to have run into some problems with
many of my "scripting" uses of clisp. All of my problems seem to revolve
around `require' and *load-paths* (and, most likely, an incorrect assumption
of mine which 2.28 exposes).

To give some background: I'm building and using all of this on RedHat
GNU/Linux 6.2, working with clisp 2.28 as downloaded from a mirror of the
GNU ftp site.

config.lisp as the following line for setting the *load-paths*:

,----[ Excerpt from config.lisp in the clisp sources ]
| (defparameter *load-paths*
|   '(#"./"           ; in the current directory
|     "~/lib/lisp/**/")   ; in all directories below $HOME/lib/lisp
|   "The list of directories where programs are searched on LOAD etc.")
`----

IOW, more or less as clisp comes "out of the box" except that I prefer not
to have the lisp directory directly in my home directory.

With a "normal" invocation of clisp:

,----
| davep@hagbard:~$ clisp -q -norc
| 
| [1]> *load-paths*
| (#P"" "~/lib/lisp/**/")
`----

Now, the first time I noticed a problem with `require' and *load-path* was
when I first started up clisp with my ~/.clisprc.lsp. I have a `require' of
a little library of mine in there:

,----
| (require :dp-lib)
| (use-package :dp-lib)
`----

but:

,----
| davep@hagbard:~$ type cl
| cl is aliased to `clisp -K full -q -ansi'
| davep@hagbard:~$ cl
| ;; Loading file /home/davep/.clisprc.lsp ...
| *** - A file with name dp-lib does not exist
| 1. Break [2]> 
`----

dp-lib exists in ~/lib/lisp:

,----
| davep@hagbard:~$ ls lib/lisp/dp-lib.fas 
| lib/lisp/dp-lib.fas
`----

If I change the `require' to a load everything works fine:

,----
| davep@hagbard:~$ cl
| ;; Loading file /home/davep/.clisprc.lsp ...
| ;;  Loading file /home/davep/lib/lisp/dp-lib.fas ...
| ;;  Loading of file /home/davep/lib/lisp/dp-lib.fas is finished.
| ;; Loading of file /home/davep/.clisprc.lsp is finished.
| [1]> 
`----

Going back to the `require' version, the *load-path* seems to be correct
prior to the `require':

,----[ Test code in ~/.clisprc.lsp ]
| (format t "~%~S~%" *load-paths*)
| (require :dp-lib)
| (use-package :dp-lib)
`----

,----
| davep@hagbard:~$ cl
| ;; Loading file /home/davep/.clisprc.lsp ...
| (#P"" "~/lib/lisp/**/")
| 
| *** - A file with name dp-lib does not exist
| 1. Break [2]> 
`----

Up as far as 2.27 this was never a problem (and I've been using clisp on and
off for a good couple or so years now). This same problem has knock on
effects on many of the tools I've written using clisp because they `require'
calls for loading various libraries no longer work.

Could I have simply made a mistake in building clisp this time round? Has
something changed between 2.27 and 2.28 which exposes an incorrect
assumption on my part? Has something "broken" between 2.27 and 2.28?

Thoughts, help and guidance would be appreciated.

-- 
Dave Pearson:                   |     lbdb.el - LBDB interface.
http://www.davep.org/           |  sawfish.el - Sawfish mode.
Emacs:                          |  uptimes.el - Record emacs uptimes.
http://www.davep.org/emacs/     | quickurl.el - Recall lists of URLs.

---

From: Sam Steingold <[email-masked]>
Date: Thu Mar 14 07:53:03 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Confused by `require', *load-paths* and clisp 2.28"
> * Sent on Thu, 14 Mar 2002 12:56:33 +0000
> * Honorable Dave Pearson <[email-masked]> writes:
>

> | ;; Loading of file /home/davep/.clisprc.lsp is finished.

1. I broke it in the 2002-02-28 patch and just fixed it in the CVS (path
   appened).  Sorry.

2. this bug slipped through because, apparently, no pretester uses
   REQUIRE.  I hope this will inspire you to participate in the next
   pre-test. 

-- 
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/>
Garbage In, Gospel Out

Index: defs1.lisp
===================================================================
RCS file: /cvsroot/clisp/clisp/src/defs1.lisp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -b -u -b -w -i -B -r1.12 -r1.13
--- defs1.lisp	1 Mar 2002 05:01:49 -0000	1.12
+++ defs1.lisp	14 Mar 2002 15:48:12 -0000	1.13
@@ -167,7 +167,7 @@
           (*load-paths* (if (null *load-truename*) *load-paths*
                             (cons (make-pathname :name nil :type nil
                                                  :defaults *load-truename*)
-                                  *load-truename*)))
+                                  *load-paths*)))
           #-CLISP (*default-pathname-defaults* '#""))
       (if (atom pathname) (load pathname) (mapcar #'load pathname)))))

---

From: Dave Pearson <[email-masked]>
Date: Thu Mar 14 08:26:11 2002

> 1. I broke it in the 2002-02-28 patch and just fixed it in the CVS (path

Much appreciated. Many thanks. No need to apologise, these things happen.

>    REQUIRE.  I hope this will inspire you to participate in the next

Inspiration has nothing to do with it (if you check back you'll see I've
pretested a number of previous releases and have reported build problems),
available time and other commitments has. You might want to consider that
before suggesting that people lack the inspiration to help this particular
free software project.

-- 
Dave Pearson
http://www.davep.org/

---

From: Sam Steingold <[email-masked]>
Date: Thu Mar 14 12:56:58 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] Confused by `require', *load-paths* and clisp 2.28"
> * Sent on Thu, 14 Mar 2002 16:25:18 +0000
> Inspiration has nothing to do with it (if you check back you'll see
> I've pretested a number of previous releases and have reported build
> problems), available time and other commitments has. You might want to

sure - I meant it as a loose quote from "up the down staircase"

> consider that before suggesting that people lack the inspiration to
> help this particular free software project.

you are not the first one to report the this bug.
I did not mean you personally, but rather the group of "require" users.
no insult intended - your contributions are appreciated.

-- 
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/>
There is an exception to every rule, including this one.

---

From: Kaz Kylheku <[email-masked]>
Date: Thu Mar 14 13:17:57 2002

How about simplifying the build? No manual steps beyond ``configure''
and ``make install''.  People shouldn't have to cd down into a
directory and then have to repeat some command.

Secondly, the -K full linkkit should have every available feature by
default: clx, regex, linuxlibc6 if applicable, etc.

This second item is important, because distribution maintainers who
include CLISP in a GNU/Linux distribution aren't going to drill down into
it to find out what configure options there are to enable extra things.
You want ``--disable-*'' negative options for people who want to hack
a smaller install.

If distributions come with minimal builds of CLISP, then application
programmers have to tell users to ignore the CLISP that came with their
system, and build one from scratch with all the right modules.  Or else
developers have to include all the right paraphernalia to build the needed
linkkit. That shouldn't be necessary for components that are
bundled with CLISP, only for custom interfaces.

---

From: Sam Steingold <[email-masked]>
Date: Thu Mar 14 17:12:12 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Build procedure."
> * Sent on Thu, 14 Mar 2002 13:10:45 -0800 (PST)
> * Honorable Kaz Kylheku <[email-masked]> writes:
>

that's what it is already.
$ ./configure --build build
$ cd build; make install

> include CLISP in a GNU/Linux distribution aren't going to drill down
> into it to find out what configure options there are to enable extra
> things.  You want ``--disable-*'' negative options for people who want
> to hack a smaller install.

it's not like distribution maintainers are fighting for the honor. :-(
first, many people use linux on an old X-less machine - so if we
distribute CLISP with full image requiring X, we lose them.
second, the build options in clisp.spec for RPM is under our control.

would you like to maintain CLISP RPMs?

-- 
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/>
char*a="char*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}