emacs-devel
[Top][All Lists]
Advanced

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

Re: Distinguishing `consp` and `functionp`


From: Yuri Khan
Subject: Re: Distinguishing `consp` and `functionp`
Date: Tue, 30 Jan 2024 00:09:11 +0700

On Mon, 29 Jan 2024 at 23:50, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> 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`)).

A backward-compatible solution for “I want to support lists but there
are already things that have the list shape, with a special symbol at
the head” is to designate a new special symbol, maybe ‘list’, to be
used at the head (and ignored except as the type designator).

(Disclaimer: I am not qualified to have an opinion as to whether
functions-as-lists should continue to be supported.)



reply via email to

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