emacs-devel
[Top][All Lists]
Advanced

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

Re: Distinguishing `consp` and `functionp`


From: Stefan Monnier
Subject: Re: Distinguishing `consp` and `functionp`
Date: Mon, 29 Jan 2024 11:28:07 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> I don't think there is much space for philosophy or debate in noting
> for example, that a list as lambda won't get byte-compiled like a
> true lambda form.
>
> (byte-compile '(let ((bla (lambda () (+ 42 42))))
>                  (funcall bla))) ;; -> (byte-code "\300\211 \207" [#[0
> "\300\207" [84] 1]] 2)
>
>
> (byte-compile '(let ((bla '(lambda () (+ 42 42))))
>                  (funcall bla)));; -> (byte-code "\300 \207" [(lambda
> nil (+ 42 42))] 1)

While it's in the vicinity, this is not directly related to my patch.

>>     commit 9228fd983bb9e71d44d406433a46495b22640801
>>     Author: Marten Lienen <marten.lienen@gmail.com>
>>     Date:   Mon Jan 22 11:08:44 2024 +0100
>>
>>         * yasnippel.el (yas-buffer-local-condition): Check functionp before 
>> consp to allow closures
[...]
> Stefan's patch moves us in the right direction if just for the guidance
> it gives to ignorant Lispers like the one who introduced that bug circa 2009.

FWIW, the bug fixed by the above commit was introduced a few days
earlier by yours truly,


        Stefan




reply via email to

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