X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefpackage.lisp;h=2d50d0a4b313d9f38a80ea731e98677ea44fe5ae;hb=b7cfa0e5e726c2037ba2c6cb32406ff7e9764dd2;hp=08ca514e0a96ed633925b4e94b110c40950f6f9f;hpb=74a48d09e08aead6f67204878bdf9be4f448e1e8;p=sbcl.git diff --git a/src/code/defpackage.lisp b/src/code/defpackage.lisp index 08ca514..2d50d0a 100644 --- a/src/code/defpackage.lisp +++ b/src/code/defpackage.lisp @@ -11,6 +11,22 @@ (in-package "SB!IMPL") +;;; the list of packages to use by default when no :USE argument is +;;; supplied to MAKE-PACKAGE or other package creation forms +;;; +;;; ANSI specifies (1) that MAKE-PACKAGE and DEFPACKAGE use the same +;;; value, and (2) that it (as an implementation-defined value) should +;;; be documented, which we do in the doc string. So for OAOO reasons +;;; we represent this value as a variable only at compile time, and +;;; then use #. readmacro hacks to splice it into the target code as a +;;; constant. +(eval-when (:compile-toplevel) + (defparameter *default-package-use-list* + ;; ANSI says this is implementation-defined. So we make it NIL, + ;; the way God intended. Anyone who actually wants a random value + ;; is free to :USE (PACKAGE-USE-LIST :CL-USER) anyway.:-| + nil)) + (defmacro defpackage (package &rest options) #!+sb-doc "Defines a new package called PACKAGE. Each of OPTIONS should be one of the @@ -120,8 +136,8 @@ (defun stringify-name (name kind) (typecase name - (simple-string name) - (string (coerce name 'simple-string)) + (simple-base-string name) + (string (coerce name 'simple-base-string)) (symbol (symbol-name name)) (base-char (string name)) (t @@ -142,7 +158,7 @@ (let ((package (or (find-package name) (progn (when (eq use :default) - (setf use *default-package-use-list*)) + (setf use '#.*default-package-use-list*)) (make-package name :use nil :internal-symbols (or size 10)