I am learning lisp and i was wondering if there were any built in help commands - ie: return help on a topic or comma开发者_开发问答nd - like (defun /?)
thanks
The standard function describe
can provide some information about objects in an implementation-specific way, e.g.
* (describe 'defun)
COMMON-LISP:DEFUN
[symbol]
DEFUN names a macro:
Lambda-list: (&ENVIRONMENT ENV NAME ARGS &BODY BODY)
Documentation:
Define a function at top level.
Source file: SYS:SRC;CODE;DEFBOOT.LISP
Common Lisp is described by a standard, ANSI Common Lisp, and that standard has been HTMLized and is available online. Its index can be used to look up the specification of a particular function, macro, special form, etc.
For a quick reference, try the CL quick reference.
I use http://l1sp.org/ for quick lookup as well.
Most CL environments have a key combination that will look things up in the HyperSpec, too. In SLIME, it's C-c C-d h
.
Try these:
(documentation 'documentation 'function)
(describe 'documentation)
(apropos "documentation")
And see http://www.lispworks.com/documentation/HyperSpec/Front/index.htm for the official specification of Common Lisp. You can install a local HTML version of Common Lisp HyperSpec (CLHS).
If you use Emacs and SLIME (http://common-lisp.net/project/slime/), you can use meta-. to see the source where a piece of code is defined. Also see ETags (or ctags) to enable this feature in your own code.
精彩评论