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 10:41:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> And the reason(s) you are "annoyed at the use of lists to represent
> function values" are?...  IOW, what will we gain by using your changes
> in this matter?

Beside taste and philosophical differences, the main motivation is to
make `consp` and `functionp` mutually exclusive so as to eliminate the
risk that a list be considered mistakenly as a function or vice versa.

I mentioned that this risk of confusion is the reason why our completion
functions do not officially support completion tables represented as
lists of symbols (even though in practice they work fine (except when
the first symbol happens to be `lambda` or `closure`)).

It also occurs in various other places where we want to allow either
a function or a list.

E.g. a recent bugfix in YASnippet:

    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




reply via email to

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