[Ecls-list] Any support for a default load path list?
Marco Antoniotti
marcoxa at cs.nyu.edu
Mon Jun 30 07:29:10 UTC 2003
On Monday, Jun 30, 2003, at 09:46 America/New_York, Dave Pearson wrote:
> * Juan Jose Garcia-Ripoll <worm at arrakis.es> [2003-06-30 15:04:47
> +0200]:
>
>> On Monday 30 June 2003 13:51, Dave Pearson wrote:
>>
>>> Does ecl have any sort of support for a default load path list?
>>> [SNIP]
>>
>> [SNIP]
>>
>> Does it fit your needs?
>
> Sort of, although I'd probably then want to hack `require' so that it
> makes
> use of that sort of code.
REQUIRE is deprecated.
>
> By way of an explanation for what I'm asking: I dabble with Common
> Lisp and,
> as part of that dabbling, I often knock up handy little tools and try
> and
> knock them up such that they'll work with all of the free and non-free
> CLs
> that I can get running on my GNU/Linux box (and often on my Windows box
> too). I tend to maintain a library of compiled code, for each of the
> CLs I
> use, in ~/lib/lisp. I then use any available ~/.init file (hence my
> previous
> question about such an init file for ecl) to set the search path for
> loading
> stuff so that any CL I run will find these files.
MK:DEFSYSTEM is your friend.
>
> This sort of nicely splices in with some stuff you mentioned a while
> ago
> about using ECL for writing "scripts".
>
>> How do the other lisps behave?
>
> Here's what I have working so far:
>
> o CLISP uses a variable called `*load-paths*', in this case I've got
> this:
>
> ,----
> | ;; Add my own lisp directory to the load-path.
> | (push "~/lib/lisp/**/" *load-paths*)
> `----
>
> in its init file.
>
> o CMUCL uses some sort of search system that I think I've partly got a
> handle on. The code I've used for working with this is:
>
> ,----
> | ;; Add my own local library to the modules list.
> | (push #p"home:lib/lisp/" (search-list "modules:"))
> `----
>
> o SBCL seems to use a list of functions for finding modules
> (presumably this
> only interacts with `require', which fits my needs). Here I've got:
>
> ,----
> | ;; Support for loading from local library.
> | (push (lambda (module)
> | (let ((target (make-pathname :directory
> | '(:absolute "home" "davep"
> "lib" "lisp")
> | :name (format nil "~A" module)
> | :type "fasl")))
> | (when (probe-file target)
> | (load target))))
> | *module-provider-functions*)
> `----
>
> All of the above let me use (require :foo) in the REPL or in code
> (yes, I
> know that `require' is deprecated but it's bloody handy for this sort
> of
> thing and it does let me do the "interesting" work in the init files
> rather
> than having to muck about in code).
>
> I am, of course, approaching this from more of a "scripting" angle
> than I am
> a "building Lisp software" angle.
Give a try to MK:DEFSYSTEM. It solves your problems in a nice way.
Cheers
--
Marco Antoniotti
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
715 Broadway 10th FL fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.
More information about the ecl-devel
mailing list