[Top][All Lists]

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

Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Docu

From: Michael Heerdegen
Subject: Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'.
Date: Tue, 19 Jan 2016 19:01:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> > From: Michael Heerdegen <address@hidden>
> > Cc: Eli Zaretskii <address@hidden>
> > Date: Tue, 19 Jan 2016 10:53:09 +0100
> > 
> > > address@hidden alist-get key value &optional default
> > > +This function is like @code{assq}, but instead of returning the
> > > entire
> > > +association for @var{key}, @code{(@var{key} . @var{value})}, it
> > > +returns just the @var{value}.  It returns @var{default} if @var{key}
> > > +is not found in @var{alist}, defaulting to @code{nil} if
> > > @var{default}
> > > +is omitted.
> > > address@hidden defun
> > 
> > Should we add that it is also a valid place expression
> > ("setf'able")?  Or
> > to the docstring?  That fact doesn't seem to be discoverable at all now.

CC'ing Stefan, I think he can clarify.

> I don't know -- should we?  I didn't find any other function for which
> we say something like that, so saw no reason to single this one out.

I think setf'ing alist-get is the preferred way now to change the value
associated to a key.  If it is, it should be discoverable in some way,
because it is an important functionality.  Unlike other functions that
are setf'able, in this case we have no equivalent setter function
defined, i think.

> In any case, if it's so important to mention that, why doesn't the
> function's doc string make a point of doing so?  Or maybe I didn't
> understand the doc string (do you?).

I think the docstring should be improved.  AFAICT the REMOVE arg makes
only sense when using the function with a gv setter.


reply via email to

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