emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation for car and cdr


From: David Kastrup
Subject: Re: Documentation for car and cdr
Date: Wed, 25 Jan 2006 00:14:32 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Mario Domenech Goulart <address@hidden> writes:

> Hello,
>
> Currently, the documentation for cdr is:
>
> ,----[ M-x describe-function <RET> cdr <RET> ]
> | cdr is a built-in function in `C source code'.
> | (cdr list)
> | 
> | Return the cdr of list.  If arg is nil, return nil.
> | Error if arg is not nil and not a cons cell.  See also `cdr-safe'.
> `----
>
> And, for car, is:
>
> ,----[ M-x describe-function <RET> car <RET> ]
> | car is a built-in function in `C source code'.
> | (car list)
> | 
> | Return the car of list.  If arg is nil, return nil.
> | Error if arg is not nil and not a cons cell.  See also `car-safe'.
> `----
>
> Saying "car returns the car" and "cdr returns the cdr" doesn't sound
> very useful for me if I would like to know what car and cdr do, unless I
> knew what "car" and "cdr" mean (then I wouldn't check the
> documentation). :-)
>
> Wouldn't it be better to write something like "Return the first
> element of list" and "Return a list containing all but the first
> element of list" for car and cdr, respectively?

No.  cons cells don't need to point to an atom in their car, or to a
cons cell or nil in their cdr.  This is fundamental Lisp terminology.
It would be ok to add a cross reference to the Elisp manual, but the
description of the functions is dead-on and should not be replaced by
some watered-down half-inaccurate stuff.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]