From: "Roland Winkler" <winkler@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: coding standard for allowed arguments of predicates
Date: Fri, 18 Dec 2020 15:59:46 -0600 [thread overview]
Message-ID: <9810.34743.119193.24541@gargle.gargle.HOWL> (raw)
In-Reply-To: <CAArVCkTYun4nwkRsyqNXU_cJPL8nnLbB9oTmBzhMtJrkWRmUHg@mail.gmail.com>
On Fri Dec 18 2020 Philipp Stephani wrote:
> Am Fr., 18. Dez. 2020 um 15:49 Uhr schrieb Roland Winkler <winkler@gnu.org>:
> > 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.
>
> 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.
Thanks; thinking about this once more it makes sense that not all
predicates need to check the type of their arguments. In the
example of `iso8601-valid-p' one could argue that it is at the
borderline of the class of predicates that check for (in this case:
very particular) types. But a caller of this predicate can handle
the possibility of non-string arguments, too.
prev parent reply other threads:[~2020-12-18 21:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 14:49 coding standard for allowed arguments of predicates Roland Winkler
2020-12-18 15:00 ` Philipp Stephani
2020-12-18 21:59 ` Roland Winkler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9810.34743.119193.24541@gargle.gargle.HOWL \
--to=winkler@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).