bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31628: 26.1; Problem in read-multiple-choice's docstring


From: Drew Adams
Subject: bug#31628: 26.1; Problem in read-multiple-choice's docstring
Date: Tue, 29 May 2018 06:49:37 -0700 (PDT)

> 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.





reply via email to

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