From: High Energy Physics Group
Subject: NCONC & Functions
Date:
Message-ID: <7142@dime.cs.umass.edu>
With some text deleted,
>> >(DEFUN foo1 () '(a b c))
>> >FOO1
>> >(foo1)
>> >(A B C)
>> >(NCONC (foo1) '(d e f))
>> >(A B C D E F)
>> >(foo1)
>> >(A B C D E F)
>> I'm told that even FOO2 is affected when
>>running Franz on a DEC station.
>
>That's a bug in Franz. Sounds like an incorrect compiler optimization to
>me -- it's translating a call to LIST all of whose arguments are quoted
>constants into a single quoted constant. Since LIST is supposed to cons a
>new list each time it is called, this changes the semantics drastically.
I have a copy of Franz's Allegro CL on my DECstation 3100, and this is what
happens:
dribbling to file "/usr/users/kgk/junk"
NIL
<cl> (defun foo2 () (list 'a 'b 'c))
FOO2
<cl> (nconc (foo2) '(it works fine))
(A B C IT WORKS FINE)
<cl> (foo2)
(A B C)
<cl> (defun foo2 () (declare (optimize (speed 3) (safety 0))) (list 'a 'b 'c))
FOO2
<cl> (compile 'foo2)
FOO2
<cl> (nconc (foo2) '(it works fine))
(A B C IT WORKS FINE)
<cl> (foo2)
(A B C)
<cl> (dribble)
As far as I can see, Allegro CL does not seem to be in error! :-) -- Kleanthes