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

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

Re: Basic Emacs Lisp question


From: Giorgos Keramidas
Subject: Re: Basic Emacs Lisp question
Date: Wed, 30 Apr 2008 21:36:50 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Wed, 30 Apr 2008 17:26:25 +0200, David Kastrup <address@hidden> wrote:
>Giorgos Keramidas <address@hidden> writes:
>>On Tue, 29 Apr 2008 17:49:19 +0200, Matthias Pfeifer <address@hidden> 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.

Ah!  Many thanks for the explanation, David.

I am only beginning to grasp Lisp myself too, so I wasn't aware that
'-quoting produces the list in the reader :)



reply via email to

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