sas*_*nin 25 lisp documentation common-lisp read-eval-print-loop
我是CL的新手,我想学习如何阅读文档字符串并从REPL获取其他帮助信息.像help(symbol)Python中,或symbol?在IPython中,或:t与:i在Haskell的GHCI.
所以,给定一个符号名称,我希望能够知道:
我找到了(documentation '_symbol_ '_type_),但这不是我需要的.我需要知道的价值符号,势必(类型'function,'variable,'compiler-macro,等)之前,我可以使用documentation.然后它只返回docstring,它可能缺少或不足以使用该符号.
例如,在Lisp中,帮助mapcar不是很有用(CLisp的REPL):
> (documentation 'mapcar 'function)
NIL
Run Code Online (Sandbox Code Playgroud)
我希望能够看到这样的东西:
>>> map?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in function map>
Namespace: Python builtin
Docstring:
map(function, sequence[, sequence, ...]) -> list
Return a list of the results of applying the function to the items of
the argument sequence(s). If more than one sequence is given, the
function is called with an argument list consisting of the corresponding
item of each sequence, substituting None for missing values when not all
sequences have the same length. If the function is None, return a list of
the items of the sequence (or a list of tuples if more than one sequence).
Run Code Online (Sandbox Code Playgroud)
Rai*_*wig 28
如上所述,Common Lisp具有标准功能:DESCRIBE,INSPECT和DOCUMENTATION.典型的Lisp IDE也将这些绑定到键和菜单.
对于标准的Common Lisp功能,大多数IDE通过击键直接链接到Common Lisp HyperSpec文档.
大多数IDE还有按键来显示arglist和文档.还有'空间arglist'功能.
LispWorks的具体示例:LispWorks参数列表信息和LispWorks Expressions菜单
我建议您阅读Slime,LispWorks编辑器,Allegro CL的ELI或您正在使用的任何IDE 的IDE手册.