emacs-devel
[Top][All Lists]
Advanced

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

Re: master 1ecd350 2/2: Evaluate some unnecessarily quoted lambdas


From: Basil L. Contovounesios
Subject: Re: master 1ecd350 2/2: Evaluate some unnecessarily quoted lambdas
Date: Sun, 21 Jun 2020 19:08:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> -    (lambda-code (byte-compile '(lambda ()))))
>> +        (lambda-code (byte-compile (lambda ()))))
>
> I can't believe I'm doing that, but: this hunk is wrong!
>
> `byte-compile` takes source code as input, not values.  It does go to
> the trouble of trying to handle the case where we pass it a function
> value that's not yet compiled because it's an important use-case in
> practice,

(Also it's advertised in its docstring.)

> but it's better to avoid it since the above means that we'll
> first turn '(lambda () ()) into a closure object which `byte-compile`
> then has to convert back to something like (lambda () ()).

Ah okay.  I admit the main reason I thought the hunk was okay is because
(byte-compile (lambda ())) and (byte-compile '(lambda ())) produce the
same byte-code.

Thanks for catching that, now reverted.

Revert last change in benchmark.el
0792f8e4f0 2020-06-21 19:01:40 +0100
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0792f8e4f0de2328c57d552a5845bdf77265a971

-- 
Basil



reply via email to

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