From: Sam S. <sd...@gn...> - 2001-03-22 20:15:49
|
---- foo.lisp ---- (defpackage "BAR" (:use)) (defpackage "FOO" (:use "BAR")) (intern "ZOT" "BAR") (export 'BAR::ZOT "BAR") (find-symbol "ZOT" "FOO") ;; BAR:ZOT :INHERITED (export 'BAR:ZOT "FOO") (find-symbol "ZOT" "FOO") ;; BAR:ZOT :EXTERNAL 'FOO:ZOT ;; BAR:ZOT (print " *** do-symbols ***") (do-symbols (x "FOO") (print (multiple-value-list (find-symbol (symbol-name x) "FOO")))) (print " *** with-package-iterator ***") (with-package-iterator (generator-fn "FOO" :internal :external :inherited) (loop (multiple-value-bind (more? symbol accessibility pkg) (generator-fn) (declare (ignore pkg)) (unless more? (return)) (print (list symbol accessibility))))) ------------------ $ clisp -q -norc -i foo.lisp -x '(quit)' ;; Loading file foo.lisp ... " *** do-symbols ***" (BAR:ZOT :EXTERNAL) (BAR:ZOT :EXTERNAL) " *** with-package-iterator ***" (BAR:ZOT :EXTERNAL) (BAR:ZOT :INHERITED) ;; Loading of file foo.lisp is finished. ouch! -- Sam Steingold (http://www.podval.org/~sds) Support Israel's right to defend herself! <http://www.i-charity.com/go/israel> Read what the Arab leaders say to their people on <http://www.memri.org/> Sufficiently advanced stupidity is indistinguishable from malice. |