(Untitled)

May 31, 2005 13:35


mike@neal:~> PAGER='head -n5' perldoc -f map
map BLOCK LIST
map EXPR,LIST
        Evaluates the BLOCK or EXPR for each element of LIST
        (locally setting $_ to each
        element) and returns the list value composed of the results of each such evalua-
        tion. In scalar context, returns the total number of elements so generated.
Ok, ( Read more... )

Leave a comment

xach June 1 2005, 20:47:33 UTC

As I understand it, during the process of generating the CLISP system,
meaningful symbol names for the arguments to built-in functions are lost. Other Lisp
implementations doesn't suffer from this.

I find it easiest to work with SLIME in Emacs, and I use SBCL most of
the time. When I type "(mapcar", the echo area displays
"(mapcar function list &rest more-lists)". If I hit M-., I am taken to
the source code of SBCL's implementation of MAPCAR. If I hit "C-c C-d
h", I'm taken to the HyperSpec page for MAPCAR (http://www.lispworks.com/documentation/HyperSpec/Body/f_mapc_.htm).
I don't tend to use the built-in HyperSpec keys very much, because I
have a smart bookmark
for it, so I can type "clhs mapcar" into my browser and it goes to the
right place.

I also just found slime-describe-function, which is bound to C-c
C-f. It produces this in SBCL:

# is a function.
Its associated name (as in FUNCTION-LAMBDA-EXPRESSION) is MAPCAR.
The function's arguments are: (FUNCTION LIST &REST MORE-LISTS)
Function documentation:
Apply FUNCTION to successive elements of LIST. Return list of FUNCTION
return values.
Its declared argument types are:
((OR FUNCTION SYMBOL) LIST &REST LIST)
Its result type is:
(VALUES LIST &OPTIONAL)
On Tue, May 17, 2005 12:32:24 PM EDT it was compiled from:
SYS:SRC;CODE;LIST.LISP
Created: Tuesday, May 3, 2005 02:16:51 PM EDT

There are a lot of options for quickly getting documentation in Common Lisp systems. I'd avoid using your knowledge of what
Perl provides as a guide to what to look for in Common Lisp. It's
easier to learn on its own terms.

Reply


Leave a comment

Up