Nick Levine <email@example.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 Warnock, PP-ASEL-IA <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607