User Tools


Variable *PACKAGE*

Value Type

Initial Value

the common-lisp-user package.

Description

Whatever package object is currently the value of *package* is referred to as the current package.

Examples

(in-package "COMMON-LISP-USER")

#<PACKAGE "COMMON-LISP-USER">

*package*

#<PACKAGE "COMMON-LISP-USER">

(make-package "SAMPLE-PACKAGE" :use '("COMMON-LISP"))

#<PACKAGE "SAMPLE-PACKAGE">

(defvar *some-symbol*)

*SOME-SYMBOL*

(list (symbol-package (let ((*package* (find-package 'sample-package))) (setf *some-symbol* (read-from-string "just-testing"))

  • some-symbol*))
  • package*) <r>(#<PACKAGE "SAMPLE-PACKAGE"> #<PACKAGE "COMMON-LISP-USER">)</r>

(list (symbol-package (read-from-string "just-testing"))

  • package*) <r>(#<PACKAGE "COMMON-LISP-USER"> #<PACKAGE "COMMON-LISP-USER">)</r>

(eq 'foo (intern "FOO"))

true

(eq 'foo (let ((*package* (find-package 'sample-package))) (intern "FOO")))

false

Affected By

See Also

Notes

None.