[CM] asdf and clm on sbcl

Ralf Mattes rm at seid-online.de
Wed Feb 15 15:02:34 PST 2017

On Thu, Feb 16, 2017 at 12:16:00AM +0100, Tito Latini wrote:
> ...
> Ralf Mattes wrote:
> >> '(in-package :asdf-user)' did the trick.
> >
> > That's ugly. In general, *-user packages are meant for interactive 
> > REPL experimentation, not for written code.
> > [...]
> The system definitions loaded from .asd files are implicitly loaded
> into the ASDF-USER package. `(in-package :asdf-user)' is redundant
> but it avoids an error with (load "clm.asd"). i

 But that's exactly how you should not use an asdf file.
 Loading the file will unconditionally execute the code in that file
 while (asdf:load-system ...) will not, once the system is loaded. That
 makes quite a difference, esp. when asdf files contain substantial
 amounts of code (CM, hintm hint ;-)

> However, with
> sbcl + asdf (no quicklisp and no init-file),
>      (load "/path/to/all.lisp")
> is simplest than
>      (require :asdf)
>      (load "/path/to/clm.asd")
>      (require :clm)

Yes, especially since clm.asd is nothing more than a minimal wrapper
around a self made loader.
Except, you loose all the benefits of asdf (conditional compilation,
not sputtering fasl files all over the place, the ability to use more
than one lisp wich uses the same fasl file extension, etc. etc.).

> If sbcl + asdf + init-file (no quicklisp), an init file is
> some-seconds-saver [(in-package :asdf-user) is unnecessary]:
>    ;; reduced ~/.sbclrc
>    (require :asdf)
>    (pushnew  #p"/path/to/clm-5/" asdf:*central-registry*)
> sh> sbcl
> (require :clm)

I wouldn't advise to use sbcl's current extension to require to load
asdf systems. You're relying on the order of sb-impl::*module-provider-functions*
(but I have to confess that 'require does give cozzy nostalgic feelings

 Cheers, RalfD

> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist

More information about the Cmdist mailing list