Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does common lisp have any built in help like (? commandName)

Tags:

common-lisp

I am learning lisp and i was wondering if there were any built in help commands - ie: return help on a topic or command - like (defun /?)

thanks

like image 575
schmoopy Avatar asked Dec 05 '22 21:12

schmoopy


2 Answers

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.

like image 66
Xach Avatar answered Feb 06 '23 22:02

Xach


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.

like image 40
peterhil Avatar answered Feb 06 '23 20:02

peterhil