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 #110 received at 61281 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: Adam Porter <adam <at> alphapapa.net>, Xie Shynur <one.last.kiss <at> outlook.com>,
 "61281 <at> debbugs.gnu.org" <61281 <at> debbugs.gnu.org>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#61281: Double backquote expansion and ", "
Date: Wed, 08 Feb 2023 00:33:04 +0100
Ihor Radchenko <yantar92 <at> posteo.net> writes:

> > Anyway, you (only) need to use trivial quoting, it is not necessary and
> > probably not good style to use the symbol "," instead of the reader
> > construct in human written code.

> Could you elaborate?

On what?  You said "We did not find a way to retain "," in the
macro-expanded sexp.", I tried to demonstrate how to handle this.  As
you see, it is not necessary to use "," the symbol, the examples all use
the reader construct syntax and quoting.

If that doesn't answer your question, please ask more specific
questions.

> > Compare:
> >
> > #+begin_src emacs-lisp
> > ;; Substitution at the same place at multiple levels:
> > (let ((f 'my-function))
> >   ``(when (funcall ,,f) (do-something)))
> > ==>
> >  `(when (funcall ,my-function)
> >     (do-something))
> >
> > ;; Substitution once, by outside level backquote:
> > (let ((f 'my-function))
> >   ``(when (funcall ,',f) (do-something)))
> > ==>
> >  `(when (funcall ,'my-function)
> >     (do-something))
> >
> > ;; Substitution once, by the inside backquote
> > ``(when (funcall ,,'f) (do-something))
> > ==>
> >   `(when (funcall ,f)
> >      (do-something))
> >
> >   or simpler:
> >
> > ``(when (funcall ,f) (do-something))
> > ==>
> >   `(when (funcall ,f)
> >      (do-something))
> > #+end_src
> >
> > You probably tried to get some of these cases work, and it's not trivial
> > to get to a solution the first time one encounters this problem.



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.