Subject: Re: bug#61281: “`(a \, b)” equals to “`(a . ,b)”

From: Michael Heerdegen <[email-masked]>
Date: Mon, 06 Feb 2023 01:13:05 +0100

Jim Porter <[email-masked]> writes:

> What about emitting a warning? That shouldn't break anything, and it
> might catch some bugs. (I'm not sure if a warning is easy to add for
> this though...)

You mean the reader should emit a warning?  Note that at least
expressions printed by Emacs itself might be printed like this, e.g.

  (nth 1 '`(a . ,b)) ==> (a \, b)

so you would get warnings for automatically generated code.

OTOH, is it that likely that people write something like the above by
accident?  If the symbol "," (with read syntax "\,") appears outside
backquote or pcase patterns at a place where it is funcalled or
referenced as a variable you already get a compiler warning.  And are we
sure that nobody ever wants to use that syntax by purpose?

BTW, if you are working with backquote expressions a lot you are seeing
such commas in apparently "normal" (undotted) lists regularly (because
the printer seems to prefer that syntax over using a dotted list, like
in the above example).  It surprises you only once or twice.

Michael.