[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Predicate for true lists
From: |
Basil L. Contovounesios |
Subject: |
Re: Predicate for true lists |
Date: |
Mon, 04 Jun 2018 15:46:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> address@hidden list-true-p object
>> +This function returns @code{t} if OBJECT is a true list, @code{nil}
>> +otherwise. In addition to satistying @code{listp}, a true list is
>> +neither circular nor dotted.
>
> I think this function's true name is `list-proper-p` or `proper-list-p`.
> At least I've always heard it talked about as "a proper list vs
> a non-proper list".
That was my impression as well, but "(elisp) Cons Cells" states:
Also by convention, the CDR of the last cons cell in a list is ‘nil’.
We call such a ‘nil’-terminated structure a “true list”.
The documentation of functions 'append' in "(elisp) Building Lists" and
'vconcat' in "(elisp) Vector Functions" similarly refer to "true" lists.
If "proper" is the more common/preferred term, I should probably update
those nodes in addition to my patch, right?
> As for `cdr` vs CDR. The all-caps version is a metavariable referring
> to something which we happened to call CDR. E.g.
>
> Foo takes the form (CAR . CDR) where CDR is blabla.
Right, but I see no such destructuring/metasyntax in the Elisp manual.
Both "(elisp) Cons Cells" and "(elisp) Cons Cell Type", for example,
refer directly to the CAR and CDR slots of a cons cell, without first
illustrating their structure. Is that OK?
Thanks,
--
Basil
Re: Predicate for true lists, Paul Eggert, 2018/06/04
Re: Predicate for true lists, Basil L. Contovounesios, 2018/06/05