From: Lowell
Subject: packages question
Date: 
Message-ID: <bhtt9f$31k$1@mughi.cs.ubc.ca>
How can I access code that is unpackaged from within packaged code? For 
instance, if I were to have a utilities file which is unpackaged and 
several packages which rely on the utilities, how would I refer to the 
utility functions from within one of the packages?

Lowell

From: Zachary Beane
Subject: Re: packages question
Date: 
Message-ID: <slrnbk4v5t.k5m.xach@unnamed.xach.com>
In article <············@mughi.cs.ubc.ca>, Lowell wrote:
> How can I access code that is unpackaged from within packaged code? For 
> instance, if I were to have a utilities file which is unpackaged and 
> several packages which rely on the utilities, how would I refer to the 
> utility functions from within one of the packages?

Nothing's truly unpackaged. The initial package is, by default,
COMMON-LISP-USER. If you load a file without specifying a package, it
will probably be loaded into the COMMON-LISP-USER package.

If that's the case, you could refer to the utility function FOO as
CL-USER:FOO, or :use "CL-USER" in the defpackage.

See http://www.lispworks.com/reference/HyperSpec/Body/v_pkg.htm for
some info about it.

Zach
From: Marco Antoniotti
Subject: Re: packages question
Date: 
Message-ID: <3F4298C4.4060607@cs.nyu.edu>
Zachary Beane wrote:
> In article <············@mughi.cs.ubc.ca>, Lowell wrote:
> 
>>How can I access code that is unpackaged from within packaged code? For 
>>instance, if I were to have a utilities file which is unpackaged and 
>>several packages which rely on the utilities, how would I refer to the 
>>utility functions from within one of the packages?
> 
> 
> Nothing's truly unpackaged. The initial package is, by default,
> COMMON-LISP-USER. If you load a file without specifying a package, it
> will probably be loaded into the COMMON-LISP-USER package.
> 
> If that's the case, you could refer to the utility function FOO as
> CL-USER:FOO, or :use "CL-USER" in the defpackage.

That will not work as reading in CL-USER does not export the symbols.

You'd have to use CL-USER::FOO to refer to the symbol.

Anyway.  Learning about packages is time well spent.

Cheers
--
Marco