[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Old-style backquote and ,@ in *.by files
From: |
Stefan Monnier |
Subject: |
Old-style backquote and ,@ in *.by files |
Date: |
Mon, 09 Oct 2017 20:41:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Hi,
We're in the process of getting rid of support for old-style backquote
(of the form (` e) and (, e)) and we bumped into the following situation
(which triggered some signal on our side):
In admin/grammars/make.by (and other grammar files) we find things like:
Makefile : bol newline (nil)
| bol variable
( ,@$2 )
as well as
targets: target opt-whitespace targets
( (car ,$1) (car ,@$3) )
But in Emacs-25, the above "(car ,@$3)" was read assuming the ,@ is
a new-style unquote, i.e. it's read as "(car (\,@ $3))", whereas the
earlier "( ,@$2 )" was read as "(\,@$2)", i.e. as a single list
containing a funny symbol named ",@$2".
I think this was a bug, which would be fixed by dropping support for
old-style backquotes, so that "( ,@$2 )" would now be read as "((\,@
$2))".
But I'm not sufficiently familiar with the bovine code to be sure
(especially since misinterpreting "( ,@$2 )" as "(\,@$2)" would likely
have been noticed, so either it's really what was intended, or else
there's presumably somewhere some hack that tries to work around this
quirk). In bovine-grammar-expand-form, I see:
(when (and (>= emacs-major-version 24)
(listp first)
(or (equal (car first) '\,)
(equal (car first) '\,@)))
(if (listp (cadr first))
(setq form (append (cdr first) form)
first (car first))
(setq first (intern (concat (symbol-name (car first))
(symbol-name (cadr first)))))))
which makes me think that maybe "(\,@$2)" is indeed what was intended,
and this code is designed to turn "(car (\,@ $3))" into "(car \,@$3)",
so that both ways to read work (the new-style reading is transformed
into the old-style reading).
Could you shine some light for us?
Stefan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Old-style backquote and ,@ in *.by files,
Stefan Monnier <=