Re: byte-opt.el addition - optimize list of compile-time constants

From:

Stefan Monnier

Subject:

Re: byte-opt.el addition - optimize list of compile-time constants

Date:

Wed, 08 Dec 2004 23:52:50 -0500

User-agent:

Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> In evidence for my position I would like to point out that it is silly
> for '(1 2 3 #'(lambda ...) 4 5 6) to mean something different than
> (list 1 2 3 #'(lambda ...) 4 5 6), and the byte compiler compiles the
> embedded lambda in the second case, so logically it ought to in the
> first case as well.
> Also, in Common Lisp the situation is clearly that the compiler _is_
> entitled to compile (function ...) wherever it finds it - Emacs Lisp
> is not the same thing, of course, but I see no reason for divergence
> here.
Note that the expression
(list 1 2 (function (lambda () (with-current-buffer))))
can be rejected by the compiler (not enough arguments to the
with-current-buffer macro) whereas
'(1 2 (function (lambda () (with-current-buffer))))
can't because it's just a quoted constant which just happens to look like
invalid code.
Stefan