Subject: AW: [clisp-list] *load-path*

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Tue Jul 9 05:33:02 2002

Rohan Nicholls

>Can someone clarify for me:
>When I want to include a package, I borrowed this from init.lisp
>(use-package '("COMMON-LISP" "CUSTOM") "EXT")

You're confusing loading smoething and using packages. I guess "Include a package" in unclear to you.

First, you need to make the foreign package available, e.g. by using a LOAD on the file containing the foreign package definition and functionality.

If you want to define your own package, DEFPACKAGE is the preferred form these days, over separate MAKE-PACKAGE, USE-PACKAGE, EXPORT, IMPORT etc.

>How does clisp know where to find "EXT", and "COMMON-LISP" or 
>"CUSTOM" for that matter?
Because it doesn't load them. USE-PACKAGE assumes it is already loaded.
Try out (LIST-ALL-PACKAGES). You can only use one of these.

Maybe REQUIRE (and PROVICE) is what you're after (automatically loading files instead of using packages)?

>Am I right in thinking that the declaration (in-package "EXT") 
>means that from here on in the code is to assume being in the 
Yes, if this form appears at top-level.
>package "EXT", so if the (use-package etc) statement above was 
>not there then any calls to functions in "COMMON-LISP" would 
>have a common-lisp:: prefix?

It depends on what package EXT uses itself.
Most packages use package COMMON-LISP.
The usual prefix should be a single colon, e.g. COMMON-LISP:LIST
:: means access to the internals - beware - private!

>I apologise if this is a monumentally stupid question 
Not so. I hope my answers bring you forward.

>seems I am stuck in the "EXT" package, and there were some 
>very helpful mails to someone else earlier on the topic, with 
>[...]
>lisp.init and see if I can put the line in at the end so clisp 
>starts in the COMMON-LISP-USER package.
I didn't follow that thread.
The idea should be that one of the last forms in INIT.LISP (before SAVE[INIT]MEM) sets the package that will be current when CLISP restarts from the saved image.

Regards,
	Jörg Höhle.