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

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

Re: plist-put: destructive?


From: Stefan Monnier
Subject: Re: plist-put: destructive?
Date: Sun, 22 Jan 2017 12:30:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> The code I'm working has many repeated clauses looking like:
>
> (when thing1
>   (setq the-plist (plist-put the-plist :thing thing1)))

FWIW, I've found that such code can often advantageously be turned
into a non-side-effecting form like:

   (let ((the-plist
          (nconc
           (when thing1 (list :key1 thing1))
           (when thing2 (list :key2 thing2))
           ...)))


-- Stefan




reply via email to

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