GNU bug report logs - #61293
30.0.50; [FR] Add `proper-list-p' and `plistp' to 2.7 Type Predicates section of the manual

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 5 Feb 2023 12:01:02 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #23 received at 61293 <at> debbugs.gnu.org (full text, mbox):

From: Basil Contovounesios <contovob <at> tcd.ie>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: Robert Pluim <rpluim <at> gmail.com>, 61293 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#61293: 30.0.50; [FR] Add `proper-list-p' and `plistp' to
 2.7 Type Predicates section of the manual
Date: Mon, 06 Feb 2023 10:43:22 +0000
Ihor Radchenko [2023-02-06 10:19 +0000] wrote:

> Robert Pluim <rpluim <at> gmail.com> writes:
>
>> One point here: Emacs allows 'improper' alists without complaining:
>>
>> (alist-get 1 '((2 . 4)
>>                5
>>                (3 . 1)
>>                (1 . 7)))
>>
>> => 7
>>
>> so weʼd have to be careful about how we defined `alistp'
>
> This is no different from plists:
>
> (plistp '(1 2 3)) ; => nil
> (plist-get '(1 2 3) 1) ; => 2

Exactly, hence why there is no 'standard' alistp, or why there was no
plistp for a very long time: every application has a different notion of
/ heuristic for what is permissible as an alist or plist.  It is
impossible to cover them all, and usually quite easy to write an
application-specific predicate (not that I object to adding alistp).

-- 
Basil




This bug report was last modified 2 years and 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.