繁体   English   中英

如何列出在常见的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获取所有包的list-all-packages ,并且对于每个包,您可以看到它使用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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM