From: Coby Beck
Subject: list data passed to macros
Date: 
Message-ID: <b2sd8q$2inf$1@otis.netspace.net.au>
Loading a file like:

(foo '(a b c) '(1 2 3))
(bar '(a b c) '(1 2 3))

can have undefined consequences where foo and bar perform destructive
operations on their data.  What if foo and bar were macros? and called
thusly:

(foo (a b c) (1 2 3))
(bar (a b c) (1 2 3))

I have some hairy macros that crawl through very long and intricate list
data and do do some destructive operations before returning a form using the
reordered data.  Is the compiler free to coalesce the two (a b c) lists and
cause me problems?

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")

From: Steven M. Haflich
Subject: Re: list data passed to macros
Date: 
Message-ID: <3E51BB84.2010704@alum.mit.edu>
ANS 3.1.2.1.2.2 is explicit that a macro may not modify
any part of its argument form.
From: Kaz Kylheku
Subject: Re: list data passed to macros
Date: 
Message-ID: <cf333042.0302191006.30574b3e@posting.google.com>
"Coby Beck" <·····@mercury.bc.ca> wrote in message news:<·············@otis.netspace.net.au>...
> What if foo and bar were macros? and called
> thusly:
> 
> (foo (a b c) (1 2 3))
> (bar (a b c) (1 2 3))
> 
> I have some hairy macros that crawl through very long and intricate list
> data and do do some destructive operations before returning a form using the
> reordered data.  Is the compiler free to coalesce the two (a b c) lists and
> cause me problems?

It doesn't matter whether you have (foo (a b c)) where FOO is a macro,
or whether you have (quote (a b c)) where QUOTE is the familiar
operator, equivalent to the shorthand '(a b c).

It's not the quote operator that makes it a constant list, but rather
the fact that the list is part of the body of the source code.

Comments?