Article View: gnu.emacs.bug
Article #99294(none)
From: UNIX-to-UNIX Copy
Date: Thu, 11 Oct 1990 01:34
Date: Thu, 11 Oct 1990 01:34
44 lines
1993 bytes
1993 bytes
Path: tnoibbc!hp4nl!mcsun!uunet!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!BREEZE.BELLCORE.COM!mlittman
From: mlittman@BREEZE.BELLCORE.COM (Michael L. Littman)
Newsgroups: gnu.emacs.bug
Subject: Backquote results in different behavior when byte-compiled
Message-ID: <9010091456.AA18404@breeze.bellcore.com>
Date: 9 Oct 90 14:56:40 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 32
System: Sparc 18.55
I am using a macro to generate a list which I then tamper with using
"setcar". Before I byte-compile, "setcar" does not produce a
side-effect to the macro. After I compile, it does.
If I define the macro any other way, I get consistent results: either
"setcar" produces side-effects in the compiled version AND the
uncompiled version, or it "setcar" produces no side-effects in the
compiled version OR the uncompiled version.
; Program:
(defmacro nil-list ()
(` (cons '(nil) nil)))
(defun change-nils (true)
(let ((a (nil-list)))
(if true
(setcar (car a) 'up)
)
a))
; Test...
(change-nils t) => ((up))
(change-nils nil) => ((nil)) ; No side effect
(byte-compile 'change-nils)
(change-nils t) => ((up))
(change-nils nil) => ((up)) ; Side effect
-Michael
Technical Details
Message-ID:
<9010110134.AA14364@tnoibbc>Path:
arc1-ca.pugleaf.net!gmdzi!unido!isaak!escher!nadia!smurf!ira.uka.de!sol.ctr.columbia.edu!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!tnoibbc.ibbc.tno.nl!uucpShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,b5ec764478ce47e0 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-10-10 18:34:30 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!isaak!escher!nadia!smurf!ira.uka.de!sol.ctr.columbia.edu!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!tnoibbc.ibbc.tno.nl!uucp From: uucp@tnoibbc.ibbc.tno.nl (UNIX-to-UNIX Copy) Newsgroups: gnu.emacs.bug Subject: (none) Message-ID: <9010110134.AA14364@tnoibbc> Date: 11 Oct 90 01:34:30 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 44 Approved: bug-gnu-emacs@prep.ai.mit.edu Posted: Thu Oct 11 02:34:30 1990