"Stephen J. Turnbull" <stephen(a)xemacs.org> writes:
>>>>> "ms" == Michael Sperber
<sperber(a)informatik.uni-tuebingen.de> writes:
ms> I'm not sure I understand your question. (Hygienic macros
ms> sure fix many problems ...) What problem would you like
ms> fixed?
push's willingness to push to a "place" specified as a literal.
PLACE wasn't specified as a literal, it just happened to refer to a
literal. There is no way a macro can generally determine whether
(push x (cdr y)) modifies a cons received through a literal or not.
If you really wanted to "fix" this, you could:
a) proclaim modification of list literals /kosher/. This would
require removing the optimization that reuses literals by storing
them to the compiled-function object.
or, you could
b) make '(...) create read-only conses and have setcar/setcdr check
for such conses. In theory, this slows down setcar and setcdr, but
I'm not sure if it would be a slow-down for us, since we have code
that checks for read-only conses anyway. But it would require
special handling of QUOTE in a way I don't like. (Currently QUOTE
simply returns what the reader gave it.)
Both "solutions" require slowdowns or complications similar to what
would be needed to allow my sample C construct to work as expected. I
don't think it's a problem worth solving.