[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: |
Sat, 21 Jan 2017 08:41:53 -0800 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> So what's the ambiguity? Are there circumstances where a simple
>> plist-put isn't going to modify the original plist?
>
> Yes, when the plist is empty.
Thanks to you both. I'm working with existing plists, so I'll drop the
setqs, that's a relief.
> BTW, in recent Emacsen, you can use
>
> (setf (alist-get K AL) V)
>
> and it works even when the alist is nil (but it requires AL to be
> a valid *place* rather than an arbitrary expression). You could make
> something similar for plist-get.
Making something similar would just be the `gv-define-simple-setter'
call I had in the original message, right?