bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34975: 26.1.92; In backquote, the comma marker does not work with va


From: Michael Heerdegen
Subject: bug#34975: 26.1.92; In backquote, the comma marker does not work with variable name started with dot
Date: Tue, 26 Mar 2019 01:03:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

> What it does in Emacs Lisp is _completely_ wrong, IMO.
>
> (setq c 42)         ; c = 42
> (setq a `(b ,. c))  ; a = (b (\,\. c))

Well, apart from the reader macro part, is has just never been
implemented.

I would already be happier if the current semantics of backquote would
be specified clearer in the docs: What happens with unquoted lists?
E.g.

(macroexpand '`(1 ,@x 3 ,@y))

 ==>
 (cons 1
      (append x
              '(3)
              y))

X is copied when evalling that, so the list stored in X is not modified
(good).  OTOH Y is not copied.  It's not necessary to copy the list
stored in Y to compute the value of the backquote expression without
modifying Y, so that's also ok.

But if you destructively modify the result of the backquote expression,
you may also change Y destructively (but not X).  Things like these
might be clear if you come from Common Lisp, but it's all not obvious
IMHO.


Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]