GNU bug report logs -
#61281
“`(a \, b)” equals to “`(a . ,b)”
Previous Next
Full log
View this message in rfc822 format
Drew Adams <drew.adams <at> oracle.com> writes:
> And the question is about "\,", not ",".
>
> (setq ,X 42) ; => 42
> (setq \,X 42) ; => (wrong-type-argument symbolp (\, X))
The other way round.
"\,X" is interpreted as symbol, just as "\,".
What's the question about "\,"?
> (I'd be interested in what the case is in Common
> Lisp, including what a typical implementation is.)
AFAIU, there are different implementations. I tested two random CL and
two random scheme interpreters. Of those 4, 3 expanded
,X --> (unquote X), and in one case ,X was read as an atomic expression.
> The question is whether \, and , should have the
> same behavior. Certainly \z and z have the same
> behavior. But character z has no special behavior
> inside a backquote.
I think the necessity to escape the comma to get the symbol has been
introduced to avoid ambiguities with uses of the reader macro.
> \@ and @ don't have the same behavior inside a
> backquote. And neither do \. and . -- only \,
> and , have the same behavior. To me, that's just
> an implementation/design thing, not something
> normal or inevitable. Not a big deal, not the
> end of the world. I minor unfortunate thing
> (gotcha).
In any case, much too late to change it.
> I pointed to the comments in the code. They tell the story. But I
> don't think there's any such explanation/description in the doc.
Yes, it would be good to add something.
Michael.
This bug report was last modified 2 years and 127 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.