On 8/28/09 10:56 PM, "David Kastrup" <d...@gnu.org> wrote:

> Carl Sorensen <c_soren...@byu.edu> writes:
> 
>> On Aug 28, 2009, at 1:16 PM, "Nicolas Sceaux" <nicolas.sce...@free.fr>
>> wrote:
>> 
>>> 
>>> According to R5RS, it is an error to modify a literal list.
>>> If a function returns '(), the caller won't be allowed to
>>> apply a modifying function on the result (eg. append!)
>>> 
>> 
>> IIUC, '() is not a literal list, but a constant that represents the
>> empty list.
> 
> It is a literal list in my opinion, but one that happens to have no
> unique and/or modifiable conses.  Append will work just fine on it.

It is *not* a literal list.

Here is the proof:

guile> (define a '(4 5))
guile> (define b '(4 5))
guile> (eq? a b)
#f
guile> (define c '())
guile> (define d '())
guile> (eq? c d)
#t


'(4 5) is a literal list, and thus a is not eq? to b, although it is equal?
to b

On the other hand, c is eq? to d, because '() is a constant, and both c and
d are set to the same constant.



Carl



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to