Variable *PACKAGE*

UP


Variable *PACKAGE*

Variable *PACKAGE*

値の型

パッケージオブジェクト

初期値

COMMON-LISP-USERパッケージ

定義

*package*の現在の値のパッケージオブジェクトは、 現在のパッケージとして参照されます。

例文

(in-package "COMMON-LISP-USER") =>  #<PACKAGE "COMMON-LISP-USER">
*package* =>  #<PACKAGE "COMMON-LISP-USER">
(make-package "SAMPLE-PACKAGE" :use '("COMMON-LISP"))
=>  #<PACKAGE "SAMPLE-PACKAGE">
(list 
  (symbol-package
    (let ((*package* (find-package 'sample-package)))
      (setq *some-symbol* (read-from-string "just-testing"))))
  *package*)
=>  (#<PACKAGE "SAMPLE-PACKAGE"> #<PACKAGE "COMMON-LISP-USER">)
(list (symbol-package (read-from-string "just-testing"))
      *package*)
=>  (#<PACKAGE "COMMON-LISP-USER"> #<PACKAGE "COMMON-LISP-USER">)
(eq 'foo (intern "FOO")) =>  true
(eq 'foo (let ((*package* (find-package 'sample-package)))
           (intern "FOO")))
=>  false

影響

load, compile-file, in-package

参考

compile-file, in-package, load, package

備考

なし。


TOP, Github