[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Documentation for car and cdr
From: |
Drew Adams |
Subject: |
RE: Documentation for car and cdr |
Date: |
Sat, 28 Jan 2006 11:57:32 -0800 |
The doc strings should *not* mention "list", especially as the
argument name. There is no reason to do so, and that can be
misleading, due to the use of "list" in the doc for both:
1) consp or null, and
2) "true list" (nil as last cdr).
Use the following doc strings (or similar). They are precise but also
clear enough wrt what the "car" and the "cdr" of a cons cell mean.
The first line provides the raison d'etre and core meaning; the other
lines mention the nil and error cases.
There is no need to cross-reference the manual explanation of "cons
cell", and the manual section on lists should definitely not be
cross-referenced. Users not understanding these doc strings will
naturally look at the doc for `cons', which is what we want them to
do.
(car ARG):
Return the car (first part) of a cons cell.
ARG must be a cons cell or nil, or else an error is raised.
(car (cons a b)) returns a.
(car nil) returns nil.
See also `car-safe'.
(cdr ARG):
Return the cdr (second part) of a cons cell.
ARG must be a cons cell or nil, or else an error is raised.
(cdr (cons a b)) returns b.
(cdr nil) returns nil.
See also `car-safe'.
- Re: Documentation for car and cdr, (continued)
- Re: Documentation for car and cdr, David Kastrup, 2006/01/26
- Re: Documentation for car and cdr, Peter Whaite, 2006/01/27
- Re: Documentation for car and cdr, Luc Teirlinck, 2006/01/28
- Re: Documentation for car and cdr, Miles Bader, 2006/01/28
- Re: Documentation for car and cdr, Luc Teirlinck, 2006/01/28
- Re: Documentation for car and cdr, Miles Bader, 2006/01/28
- Re: Documentation for car and cdr, Luc Teirlinck, 2006/01/28
- RE: Documentation for car and cdr,
Drew Adams <=
- RE: Documentation for car and cdr, Drew Adams, 2006/01/28
- RE: Documentation for car and cdr, Drew Adams, 2006/01/30
- Re: Documentation for car and cdr, Alan Mackenzie, 2006/01/26
- Re: Documentation for car and cdr, Tomas Zerolo, 2006/01/26
- Re: Documentation for car and cdr, Ken Manheimer, 2006/01/29
- Re: Documentation for car and cdr, Ken Manheimer, 2006/01/29
- Re: Documentation for car and cdr, Luc Teirlinck, 2006/01/29
- Re: Documentation for car and cdr, Ken Manheimer, 2006/01/30
- Re: Documentation for car and cdr, Alex Schroeder, 2006/01/31
- Re: Documentation for car and cdr, Kevin Rodgers, 2006/01/31