From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Add-to-list or setq append... Date: Wed, 04 Aug 2010 03:02:31 +0200 Organization: Informatimago Message-ID: <8739uvtck8.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291861718 17083 80.91.229.12 (9 Dec 2010 02:28:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 02:28:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 03:28:34 2010 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.69) (envelope-from ) id 1PQWFC-0002Ou-8b for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 03:28:30 +0100 Original-Received: from localhost ([127.0.0.1]:56251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQWFB-0001Ar-73 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 21:28:29 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: individual.net Zxv7/2FnyxDCr80K6avPRgQUKivYSaglJ2iAjBKjQ3C4ClpNSD Cancel-Lock: sha1:NGUxNDQ2MmVhZTFhYjZhMGI4NjM4MDM0YzdlZDY5YWJiOTJiZDQxNA== sha1:jxrA4S1bzkV8SZmp/YYm/vx4EEQ= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:180334 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:76478 Archived-At: Andrea Crotti writes: > Just a curiosity, I was wondering why in so many README and doc they > suggest to add elements to lists with something like: > > --8<---------------cut here---------------start------------->8--- > (setq list (append list element)) > --8<---------------cut here---------------end--------------->8--- > > instead of doing simply > --8<---------------cut here---------------start------------->8--- > (add-to-list list-va element) > --8<---------------cut here---------------end--------------->8--- > > Is there any good reason or is just historical heritage? > I think add-to-list is even more smart adding only if not there already, > then what's the point in using that ugly form? I would rather use: (require 'cl) (pushnew element list-va) than add-to-list. -- __Pascal Bourguignon__ http://www.informatimago.com/