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: Drew Adams
Subject: bug#34975: 26.1.92; In backquote, the comma marker does not work with variable name started with dot
Date: Sun, 24 Mar 2019 17:06:04 -0700 (PDT)

> AFAIU ,. is a reader macro: (car (read ",.foo"))
>   ==> \,\.
> 
> I dunno or have forgotten for what it had been intended, there are no
> real uses in the Emacs Elisp sources.
> 
> > (let ((.foo 42)) `(,.foo))

Yes, it's intended.  It acts the same as ,@

I might use it instead of ,@ to convey (to a human)
a connotation that what follows is not a proper list
(or is not necessarily a proper list), whereas ,@ is
typically thought of as splicing in a list of elements.

(I don't in fact use it, apparently, but I thought I
might have, and if I did use it instead of ,@ then it
would no doubt be for that reason.)

On the other hand, Common Lisp says that ,. has this
difference in meaning from ,@:

"Anywhere ``,@'' may be used, the syntax ``,.'' may
be used instead to indicate that it is permissible
to destroy the list produced by the form following
the ``,.''; this may permit more efficient code,
using nconc instead of append, for example."

https://www.cs.cmu.edu/Groups/AI/util/html/cltl/clm/node190.html#BACKQUOTE
 
> You would have to write it differently, e.g.
> 
> (let ((.foo 42)) `((\, .foo)))
>   ==> (42)

Yes.





reply via email to

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