emacs-devel
[Top][All Lists]
Advanced

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

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


From: John Wiegley
Subject: Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'.
Date: Tue, 19 Jan 2016 09:59:23 -0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin)

>>>>> Eli Zaretskii <address@hidden> writes:

>> > address@hidden alist-get key value &optional default
>> 
>> 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.

> 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. Did I miss
> something?

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

alist-get is extremely welcome, I'm quite tired of writing (cdr (assq ...)).
The fact that it is a setf "place" is also quite wonderful.

But where to document that fact so people find it... `setf' is applicable in
many scenarios, which people familiar with setf mainly know -- since I imagine
not many people use setf who are not from the CL world.

We could start adding something like this at the bottom of such functions:

  Invocations of this function may be used as a place expression to `setf'.

That is, if we wish to encourage `setf' use. The other possibility is to add
documentation to the Elisp manual where it describes `setf', and list all the
functions that may be used by it. I have a feeling that would reach your
intended audience better than extending the docstring for `alist-get'.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

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