GNU bug report logs -
#34708
alist-get has unclear documentation
Previous Next
Full log
View this message in rfc822 format
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Thanks for spelling all this out! I guess my confusion is the
>> interaction of REMOVE with DEFAULT. Why does REMOVE only do anything
>> if the value being set is equal to the DEFAULT? If they are not equal,
>> REMOVE is ignored, and the value is set. How does that make sense?
>
> If you do (setf GV V) with some place expression GV and some value V,
> you expect that afterwards GV evaluates to V.
>
> If (setf (alist-get key alist nil 'remove) t) would remove the
> association of KEY,
>
> (alist-get key alist nil 'remove)
>
> or
>
> (alist-get key alist nil)
>
> would not eval to nil, although you have set the place to t.
>
> With other words: removing elements from an alist is something that
> doesn't fit 100% to place expressions, so the syntax and semantics you
> get are not 100% straightforward. Not super sexy, but consistent.
Okay, I guess that makes sense, thanks. But we still need some more
examples in the docstring!
This bug report was last modified 6 years and 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.