GNU bug report logs - #61281
“`(a \, b)” equals to “`(a . ,b)”

Previous Next

Package: emacs;

Reported by: Xie Shynur <one.last.kiss <at> outlook.com>

Date: Sat, 4 Feb 2023 23:29:02 UTC

Severity: normal

Full log


Message #17 received at 61281 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Xie Shynur <one.last.kiss <at> outlook.com>,
 "61281 <at> debbugs.gnu.org" <61281 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#61281: “`(a \,
  b)” equals to “`(a . , b)”
Date: Sun, 5 Feb 2023 03:30:40 +0000
> > 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.