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")
"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?