GNU bug report logs -
#61281
“`(a \, b)” equals to “`(a . ,b)”
Previous Next
Full log
View this message in rfc822 format
> > Good catch!
> >
> > `(a \, b) returns (a . <value-of-b>)
> >
> > Looks like a bug to me.
>
> Isn't `(a \, b) just another read syntax for
> `(a . (\, b)), which is another syntax for
> `(a . ,b) ?
Well, yes. And that's no doubt why we get that.
But (\, b) shouldn't be handled as ,b. I know
that it is - in Elisp. I don't think it should
be. To me, that spells (faulty) implementation
leaking out.
> With other words, I think `(a \, b) and `(a . ,b) are different read
> syntaxes for the same expression, equivalent to (cons 'a b).
Yes, but see above. I think \, should be read
as the symbol whose print name is ",". To me,
`(a \, b) should be treated like (a foo b): a
list of 3 symbols - no evaluation. And `(a \,b)
should be treated as a list of two symbols,
whose print names are "a" and ",b".
The symbol \, should be read as just a symbol.
The same is not true of just an unescaped comma
- outside a backquoted sexp that raises an error,
and inside one it's handled specially as part of
the backquote syntax.
\, is not just ,
I don't have another Lisp interpreter, but I'm
guessing that Common Lisp does what I expect.
(For Common Lisp also, \ escapes a character.)
This bug report was last modified 2 years and 184 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.