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

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

Re: plist-put: destructive?


From: Eric Abrahamsen
Subject: Re: plist-put: destructive?
Date: Sun, 22 Jan 2017 05:10:02 -0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux)

Philipp Stephani <p.stephani2@gmail.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> schrieb am So., 22. Jan. 2017 um
> 01:57 Uhr:
>
>> Drew Adams <drew.adams@oracle.com> writes:
>>
>> >> Thanks to you both. I'm working with existing plists, so I'll drop
>> >> the setqs, that's a relief.
>> >
>> > Why is it a relief - a relief from what?  What if something reset your
>> "existing plist" to nil behind your back?
>>
>> The code I'm working has many repeated clauses looking like:
>>
>> (when thing1
>>   (setq the-plist (plist-put the-plist :thing thing1)))
>>
>> A little more complicated than that, but there will be like seven of
>> those in a row. Probably I should just write myself a custom
>> bulk-conditional-plist-setter macro, probably using the gv setter, but
>> for the time being just being able to remove all the "(setq the-plist"
>> makes everything easier to read.
>>
>
>  You could also write
> (cl-callf plist-put the-plist :thing thing1)

Thanks, that was a new one for me!




reply via email to

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