emacs-devel
[Top][All Lists]
Advanced

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

Re: Old-style backquotes in cc-vars.el


From: Alan Mackenzie
Subject: Re: Old-style backquotes in cc-vars.el
Date: Sat, 6 Oct 2007 16:31:01 +0000
User-agent: Mutt/1.5.9i

Hi, Stefan!

On Thu, Aug 23, 2007 at 04:51:08PM -0400, Stefan Monnier wrote:

> cc-vars uses a mix of old-style a new-style backquotes.

I don't think it does.  The patch to cc-vars.el which created this form
was made by Martin S. on 2001-09-23.  He wouldn't knowingly have put in
old-style BQs as late as 2001.  But he might well have just tried one
thing after another until he got something to work.  I've CC'd him, just
in case he'd like to comment.  The exact patch can be seen at

<http://cc-mode.cvs.sourceforge.net/cc-mode/cc-mode/cc-vars.el?r1=5.112&r2=5.113>.

> I've fixed other uses of old-style backquotes in Emacs-22 but feel like
> there may be something fishy going on here, ....

Indeed.  At the risk of offending against public decency regulations, here
is the form lread.c is complaining about:  ;-)

,@(plist-put
   args ':type
   `(` (radio                                <==========================
        (const :tag "Use style settings"
               set-from-style)
        ,(, (let ((type (eval (plist-get args ':type))))
              (unless (consp type)
                (setq type (list type)))
              (unless (c-safe (plist-get (cdr type) ':value))
                (setcdr type (append '(:value (, -value-))
                                     (cdr type))))
              (unless (c-safe (plist-get (cdr type) ':tag))
                (setcdr type (append '(:tag "Override style settings")
                                     (cdr type))))
              (bq-process type))))))

I think (but I'm not entirely sure) the associativity of the backticks
and braces is:

    `( `(radio            , not            ` (` (radio

, i.e. I think it is actually nested new-style backquotes.  I've given
up trying to figure out when the inner commas get evaluated.

I'm not sure whether the rules for nested backquotes are clearly laid
out anywhere.  I think they're formally ambiguous (i.e., RTFS).  I tried
replacing "`(` (radio" with both

    "`( (` (radio"        (explicitly putting in an "old-style" BQ)

, and

    "`` (radio"           (replacing the alleged "old-style" BQ with a
                           "new-style" one)

, but each of these generated results different from the original
(checked with macroexpand).


> ...., so I'd rather someone else does the conversion here.

So would I.  ;-(

Who is the bytecomp expert, again?  Could we possibly ask him about the
semantics of  `(` (radio ?

Possibly, the analysis in lread.c needs to be done more rigorously.

>         Stefan

-- 
Alan.




reply via email to

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