From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: plist-put: destructive? Date: Sun, 22 Jan 2017 12:30:49 -0500 Message-ID: References: <87mvelzgrr.fsf@ericabrahamsen.net> <8737gcxt4e.fsf@ericabrahamsen.net> <87tw8rx6he.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485120793 22743 195.159.176.226 (22 Jan 2017 21:33:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jan 2017 21:33:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 22 22:33:09 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVPkr-0004HE-0y for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 22:32:53 +0100 Original-Received: from localhost ([::1]:37817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVPkw-0000Kk-6m for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Jan 2017 16:32:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVLzB-0002k1-7w for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 12:31:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVLz8-0003PW-2z for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 12:31:25 -0500 Original-Received: from [195.159.176.226] (port=55656 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cVLz7-0003P2-Ru for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 12:31:22 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cVLyq-00088f-D0 for help-gnu-emacs@gnu.org; Sun, 22 Jan 2017 18:31:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:DuK3nPXzbRbh8tB3b8GSk7l083Y= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sun, 22 Jan 2017 16:32:10 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112146 Archived-At: > 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