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: Kim F. Storm
Subject: Re: Documentation for car and cdr
Date: Wed, 25 Jan 2006 23:51:38 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Describing basic concepts like car, cdr, cons cell, list and so on is
> the task of manuals, not of docstrings.  If somebody is not familiar
> with the basic concepts, they have to read a manual, where those
> concepts can be put into the proper context, _not_ individual docstrings.

I fully agree, but notice that the doc strings for car and cdr 
say that the arg is "list".  I think that part of the confusion
is that a "pure" list does have a head and a tail and car==head
and cdr==tail.

It might better to change the arg from "list" to "cons", i.e.

car is a built-in function in `C source code'.
(car CONS)

Return the car of cons cell CONS.  If arg is nil, return nil.
Error if arg is not nil and not a cons cell.  See also `car-safe'.


cdr is a built-in function in `C source code'.
(cdr CONS)

Return the cdr of cons cell CONS.  If arg is nil, return nil.
Error if arg is not nil and not a cons cell.  See also `cdr-safe'.


-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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