Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!netcom!stratus!cloud9!jjmhome!m2c!umvlsi!dime!smectos!HEP From: HEP@smectos.gang.umass.edu (High Energy Physics Group) Newsgroups: comp.lang.lisp Subject: NCONC & Functions Message-ID: <7142@dime.cs.umass.edu> Date: 29 Nov 89 18:38:48 GMT Sender: news@dime.cs.umass.edu Reply-To: HEP@smectos.CS.UMASS.EDU (High Energy Physics Group) Organization: University of Massachusetts, Amherst Lines: 40 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 (defun foo2 () (list 'a 'b 'c)) FOO2 (nconc (foo2) '(it works fine)) (A B C IT WORKS FINE) (foo2) (A B C) (defun foo2 () (declare (optimize (speed 3) (safety 0))) (list 'a 'b 'c)) FOO2 (compile 'foo2) FOO2 (nconc (foo2) '(it works fine)) (A B C IT WORKS FINE) (foo2) (A B C) (dribble) As far as I can see, Allegro CL does not seem to be in error! :-) -- Kleanthes