emacs-devel
[Top][All Lists]
Advanced

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

Re: coding standard for allowed arguments of predicates


From: Philipp Stephani
Subject: Re: coding standard for allowed arguments of predicates
Date: Fri, 18 Dec 2020 16:00:14 +0100

Am Fr., 18. Dez. 2020 um 15:49 Uhr schrieb Roland Winkler <winkler@gnu.org>:
>
> Is there a coding standard for allowed arguments of predicates?
> I have always assumed that predicates should accept any type of
> argument;  but I cannot find this documented anywhere.
>
> The context of my question is `iso8601-valid-p'.  It assumes that
> its argument must be a string.  Is this a bug?  In my usage example,
> the argument of `iso8601-valid-p' could also be nil.
>
> If, indeed, predicates should always accept any type of argument,
> I suggest to document this in the elisp manual.
>

There are lots of predicates that accept only certain types, e.g.
(file-readable-p 123) also signals an error. Typically only the
predicates that check for types (stringp, integerp, listp, etc.)
accept any type.



reply via email to

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