[Top][All Lists]

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

Re: Bootstrapping failure

From: Stefan Monnier
Subject: Re: Bootstrapping failure
Date: Thu, 13 Oct 2005 17:19:56 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> I've just installed a change that should fix it,
> It doesn't.


OK, here is the problem: mixal-mode.el has now a big constant built with
a backquote.  Originally, it blew up the byte-compiler's stack because the
backquote macroexpands into a very deep expression.  So I wrapped the thing
in an eval-when-compile because there's really no point in byte-compiling
the big expression since it actually returns a constant value and can be
evaluated quickly once and for all without being byte-compiled.

But as it turns out, the definition of eval-when-compile (in
byte-compile-initial-macro-environment) is

  (byte-compile-eval (byte-compile-top-level (cons 'progn body)))

I.e. it byte-compiles before evaluating.  So my "fix" didn't fix anything
since the deep expression still gets byte-compiled.  I find this behavior to
be wrong, and indeed if we change it to just

  (byte-compile-eval (cons 'progn body))

the problem goes away.  I find it kind of silly to byte-compile the content
of an eval-when-compile since the bytecode will only be evaluated once, but
maybe I'm missing something?  Note that this behavior dates back to version
1.1 of bytecomp.el (Jul 92).

In any case if the patch below is not acceptable, I guess I'll
replace the big backquote with the result of its evaluation.


--- bytecomp.el 22 aoĆ» 2005 10:22:50 -0400      2.178
+++ bytecomp.el 13 oct 2005 17:07:10 -0400      
@@ -429,8 +429,7 @@
 ;;                            (apply 'byte-compiler-options-handler forms)))
     (eval-when-compile . (lambda (&rest body)
                           (list 'quote
-                                (byte-compile-eval (byte-compile-top-level
-                                                    (cons 'progn body))))))
+                                (byte-compile-eval (cons 'progn body)))))
     (eval-and-compile . (lambda (&rest body)
                          (byte-compile-eval-before-compile (cons 'progn body))
                          (cons 'progn body))))

reply via email to

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