From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Is it safe to modify a property list directly with PLIST-PUT? Date: Sun, 26 Jul 2009 19:38:40 +0300 Organization: A noiseless patient Spider Message-ID: <87ab2rs8kv.fsf@iki.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248626452 30486 80.91.229.12 (26 Jul 2009 16:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2009 16:40:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 26 18:40:45 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MV6mC-0001yA-K9 for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Jul 2009 18:40:44 +0200 Original-Received: from localhost ([127.0.0.1]:35016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV6mC-0004vO-3x for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Jul 2009 12:40:44 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-X-Trace: news.eternal-september.org U2FsdGVkX1+dANgIOOMoH3IoI7/eK3HHPC6UCroDWWQRLXP9ylIh/B5SOCQYrpJM3oq6Ve2vIHuIUwJLFkNGShsvY0LgaaCoaD8Y7wVLN8e/SjQrtnVbQ3i6dgQa/fQenPqpKp4tlfY= Original-X-Complaints-To: abuse@eternal-september.org Original-NNTP-Posting-Date: Sun, 26 Jul 2009 16:38:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-Auth-Sender: U2FsdGVkX18Q5YIztoo9BCZFf4vk/5NZ2aSJ0yLSedkhK5SI13o/2w== Cancel-Lock: sha1:XcigIVxhy9iAaUJAWMGEdcQ6qL0= sha1:81UXSf+rTLp/NcQkTDEv+RMv7DM= Original-Xref: news.stanford.edu gnu.emacs.help:171206 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66393 Archived-At: I use a list of property lists to store data. It's like this: (setq my-data '((:foo "one" :bar "two") (:foo "three" :bar "four"))) Sometimes I need to modify the data and a command like this seems to work: (plist-put (nth 1 my-data) :bar "New value") That is, PLIST-PUT modifies the property list and variable MY-DATA contains now the modified list: ((:foo "one" :bar "two") (:foo "three" :bar "New value")) The question: Is this reliable? Is it guaranteed that it will always modify the list correctly? If not, how would you suggest doing it instead? Common Lisp has so nice SETF macro...