如何列出所有在 common lisp 中处于活动状态的已定义函数和全局变量
How can I list all of the defined functions and global variables that are active in common lisp
是否可以从 运行 系统本身确定当前环境定义的内容(在常见的 lisp 图像中)?
我是 运行 GNU Emacs 25.1.1 中的 SBCL 1.3.14 和 SLIME 2016-04-19。
您可以使用 list-all-packages
, and for each package you can see what goodies it export using do-external-symbols
:
获取所有包的列表
(do-external-symbols (s "SB-EXT")
(when (fboundp s)
(format t "~S names a function~%" s))
(when (boundp s)
(format t "~S names a variable~%" s)))
您可能还想查看 documentation
:
(do-external-symbols (s "SB-EXT")
(when (and (fboundp s) (documentation s 'function))
(format t "~S names a documented function~%" s))
(when (and (boundp s) (documentation s 'variable))
(format t "~S names a documented variable~%" s)))
PS。如果您正在寻找特定的东西,您还应该尝试 apropos
.
是否可以从 运行 系统本身确定当前环境定义的内容(在常见的 lisp 图像中)?
我是 运行 GNU Emacs 25.1.1 中的 SBCL 1.3.14 和 SLIME 2016-04-19。
您可以使用 list-all-packages
, and for each package you can see what goodies it export using do-external-symbols
:
(do-external-symbols (s "SB-EXT")
(when (fboundp s)
(format t "~S names a function~%" s))
(when (boundp s)
(format t "~S names a variable~%" s)))
您可能还想查看 documentation
:
(do-external-symbols (s "SB-EXT")
(when (and (fboundp s) (documentation s 'function))
(format t "~S names a documented function~%" s))
(when (and (boundp s) (documentation s 'variable))
(format t "~S names a documented variable~%" s)))
PS。如果您正在寻找特定的东西,您还应该尝试 apropos
.