Subject: Re: basic question about packages
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 20 Aug 2003 09:20:18 -0500
Newsgroups: comp.lang.lisp
Message-ID: <5nGdnWIqFKY_Ht6iXTWc-g@speakeasy.net>
Nick Levine <ndl@ravenbrook.com> wrote:
+---------------
| > Emacs (ILISP and, I think, ELI) also have that limitation. But I was
| > talking about putting the single DEFPACKAGE in the file with the IN-PACKAGE:
| > 
| >   (defpackage #:foo
| >     (:use #:common-lisp)
| >     (:export #:bar #:baz))
| > 
| >   (in-package #:foo)
| > 
| >   ;; code ...
| 
| Right you are. But - somewhat pedantically - in what package is the
| defpackage form?
+---------------

Well, it had *better* be in a package that already USEs COMMON-LISP,
of course, or DEFPACKAGE might not be accessible (or be the wrong thing!).
But almost always at the beginning of loading files into a system you're
in COMMON-LISP-USER, although I have occasionally seen some code put an
explicit (cl:in-package :cl-user) before the DEFPACKAGE, just to be sure. 

Which is also why everybody likes to use uninterned symbols to specify
the symbol names, to avoid polluting the COMMON-LISP-USER package (or
whatever package you're in).  But you knew that...  ;-}


-Rob

-----
Rob Warnock, PP-ASEL-IA		<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607