GNU bug report logs -
#31628
26.1; Problem in read-multiple-choice's docstring
Previous Next
Reported by: Damien Cassou <damien <at> cassou.me>
Date: Mon, 28 May 2018 15:24:02 UTC
Severity: minor
Tags: fixed
Found in version 26.1
Fixed in version 26.2
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Technically, a list of (A B C) is as much an alist as a list of (A . B),
> but I agree that the docstring can be clarified a bit.
No - assuming you mean that A, B, and C are elements of the
list and they are atoms, not cons cells.
From (elisp) `Association Lists':
It is a list of cons cells called "associations": the CAR of
each cons cell is the "key", and the CDR is the "associated
value".
Alist elements are cons cells, in Emacs Lisp as in other
Lisps.
It's true that functions that look up an association do not
raise an error if a list element is not a cons.
In Emacs Lisp, it is _not_ an error if an element of an
association list is not a cons cell. The alist search
functions simply ignore such elements. Many other versions
of Lisp signal errors in such cases.
Ignoring such elements, like raising an error for such an
element, does not mean that such an element is an
association or that an alist is just any old list.
And yes, there is even one function, `assoc-default', that
treats an atomic list element as if it were an association.
IOW, `assoc-default' works with any list, not just with alists.
This bug report was last modified 6 years and 358 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.