unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Adam Porter <adam@alphapapa.net>,
	Xie Shynur <one.last.kiss@outlook.com>,
	"61281@debbugs.gnu.org" <61281@debbugs.gnu.org>,
	Drew Adams <drew.adams@oracle.com>
Subject: bug#61281: Double backquote expansion and ", " (was: bug#61281: “`(a \, b)” equals to “`(a . , b)”)
Date: Tue, 07 Feb 2023 11:50:47 +0000	[thread overview]
Message-ID: <87pmal8zjc.fsf@localhost> (raw)
In-Reply-To: <87o7q68d84.fsf@web.de>

Michael Heerdegen <michael_heerdegen@web.de> writes:

> But this has not directly a relation to what we discuss here.  If you
> rewrite ,X as (\, X) you have additional ways to express the above
> things, looking like (,'\, X) etc (though these are less readable).

I may indeed be misunderstanding the case I raised vs. the discussed bug.
Let's branch this off.

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> I recall one user had a need to macro-expand something that indented to
>> be passed to another macro-expand. We did not find a way to retain ","
>> in the macro-expanded sexp.
>
> I guess you are describing the common difficulties related to multiple
> levels of backquotes (nested backquotes).  These are tricky (for human
> brains) and you need to know little "tricks" to get what you want (took
> me a while to discover how to deal with nested backquotes, maybe we
> should have examples in the manual?).

I would appreciate having such examples in the manual.
Also, CCing Adam, who originally raised the question.

> 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?

> 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.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





  reply	other threads:[~2023-02-07 11:50 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 23:23 bug#61281: “`(a \, b)” equals to “`(a . , b)” Xie Shynur
2023-02-04 23:34 ` Drew Adams
2023-02-04 23:43   ` Drew Adams
2023-02-05  0:28   ` Michael Heerdegen
2023-02-05  3:30     ` Drew Adams
2023-02-05  4:32       ` Michael Heerdegen
2023-02-05  4:55         ` Michael Heerdegen
2023-02-05 15:53           ` Drew Adams
2023-02-05 23:56             ` Michael Heerdegen
2023-02-06  2:26               ` Drew Adams
2023-02-06  3:03                 ` Michael Heerdegen
2023-02-06  3:49                   ` Drew Adams
2023-02-06 10:49                 ` Ihor Radchenko
2023-02-06 16:46                   ` Drew Adams
2023-02-07  1:07                     ` Michael Heerdegen
2023-02-07  1:40                   ` Michael Heerdegen
2023-02-07 11:50                     ` Ihor Radchenko [this message]
2023-02-07 23:33                       ` bug#61281: Double backquote expansion and ", " Michael Heerdegen
2023-02-06  9:40               ` bug#61281: “`(a \, b)” equals to “`(a . , b)” Andreas Schwab
2023-02-06 16:43                 ` Drew Adams
2023-02-07  8:56                   ` Andreas Schwab
2023-02-07 18:00                     ` Drew Adams
2023-02-07 23:44                       ` Michael Heerdegen
2023-02-08  3:09                         ` Drew Adams
2023-02-08  9:06                           ` Andreas Schwab
2023-02-09  1:29                           ` Michael Heerdegen
2023-02-09  2:04                             ` Drew Adams
2023-02-09  2:15                               ` Michael Heerdegen
2023-02-08  9:12                       ` Andreas Schwab
2023-02-05  6:32         ` Jim Porter
2023-02-06  0:13           ` Michael Heerdegen
2023-02-06  0:18             ` Michael Heerdegen
2023-02-06  1:14               ` Jim Porter
2023-02-05 15:48         ` Drew Adams
2023-02-05 23:17           ` Michael Heerdegen
2023-02-06  1:49             ` Drew Adams
2023-02-06  4:11 ` Michael Heerdegen
2023-02-06  5:01   ` Drew Adams
2023-02-06  5:22     ` Drew Adams
2023-02-06  5:25     ` Michael Heerdegen
2023-02-06 16:43       ` Drew Adams
2023-02-07  2:00         ` Michael Heerdegen
2023-02-07 18:00           ` Drew Adams
2023-02-07 23:36             ` Michael Heerdegen
2023-02-08  3:09               ` Drew Adams
2023-02-09  1:37                 ` Michael Heerdegen
2023-02-09  2:10                   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmal8zjc.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=61281@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    --cc=drew.adams@oracle.com \
    --cc=michael_heerdegen@web.de \
    --cc=one.last.kiss@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).