From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Basic Emacs Lisp question Date: Wed, 30 Apr 2008 17:26:25 +0200 Organization: Organization?!? Message-ID: <85r6cnl5y6.fsf@lola.goethe.zz> References: <67p1csF2qe3gfU1@mid.dfncis.de> <87od7sa6ke.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209570106 29367 80.91.229.12 (30 Apr 2008 15:41:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2008 15:41:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 30 17:42:14 2008 connect(): Connection refused 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 1JrERE-0003HI-6D for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2008 17:41:44 +0200 Original-Received: from localhost ([127.0.0.1]:54972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JrEQW-0005PC-Ub for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Apr 2008 11:41:00 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:uFMzboYbgVk3qvNNKZ3gyHh45gs= Original-Lines: 35 Original-NNTP-Posting-Date: 30 Apr 2008 17:26:28 CEST Original-NNTP-Posting-Host: 9b6244ed.newsspool1.arcor-online.net Original-X-Trace: DXC=YQ[IIQiZ]763ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2L^mj1?OIlQ31_LiI6ENVa=3>5MOK` 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:53649 Archived-At: Giorgos Keramidas writes: > On Tue, 29 Apr 2008 17:49:19 +0200, Matthias Pfeifer wrote: >> Hello, >> >> What is the difference between >> >> (list 0 nil -1) >> >> and >> >> '(0 nil -1) > > In Common Lisp (list 0 nil -1) is required to 'cons' a new list every > time it is called. Quoting the list as in '(0 nil -1) is not required > to build a new list. In fact, in compiled code it may reuse the same > static object over and over again. Wrong word choice. Not "may", but "must". ' produces a list in the Lisp reader. Nothing may afterwards create gratuitious unannounced copies. So whether your code is compiled or interpreted: if it is not reread, no new object is created. I can write (interpreted) (progn (setq x '(5)) (dotimes (i 5) (push i x)) x) and get (4 3 2 1 0 5) and that is the only permitted behavior. In contrast, list must always create a fresh object. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum