[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Naming predicates (was: master d0c77a1: Remove some assumptions abou
From: |
Drew Adams |
Subject: |
RE: Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format) |
Date: |
Fri, 28 Sep 2018 12:41:02 -0700 (PDT) |
> > If the purpose of a function is to tell you whether a certain
> > condition is true or false, give the function a name that ends in
> > 'p' (which stands for "predicate"). If the name is one word, add
> > just 'p'; if the name is multiple words, add '-p'. Examples are
> > 'framep' and 'frame-live-p'.
>
> Thanks for the pointer; I'd forgotten that. But there are several
> counterexamples:
Yes, there are counterexamples of most of the conventions.
There also lots of examples of the conventions being followed.
And of course we are free to remove/abandon a convention,
if it's considered not worthwhile.
But as long as we have our defined conventions, the point is
to encourage their use, and so to discourage more and more
such counterexamples.
There could presumably (e.g., in the future) be some
intentional counterexamples, i.e., based on some reasons.
I don't know of any such so far, but the possibility is there.
We don't worship hobgoblin consistency for its own sake,
above all other considerations. ;-)
Other than that possibility, I expect that the existing
counterexamples are historical or accidental, where
"accidental" means unintended by the author and not
caught and corrected by reviewers. Stuff happens.
> The Common Lisp influence seems to be causing a lot of Elisp code to
> violate the guideline, which may help to explain why I can never
> remember it.
Indeed, Emacs Lisp and Emacs have their own conventions.
In some cases Emacs Lisp has a convention where Common
Lisp has none (nothing comes immediately to mind, but I'm
pretty sure there are some examples).
And vice versa. A good example is the Common Lisp
convention to name "special" variables (defvars) `*...*'.
Elisp has no convention for such naming.
- Re: master d0c77a1: Remove some assumptions about timestamp format, (continued)
- Re: master d0c77a1: Remove some assumptions about timestamp format, Paul Eggert, 2018/09/27
- Re: master d0c77a1: Remove some assumptions about timestamp format, Michael Albinus, 2018/09/28
- Re: master d0c77a1: Remove some assumptions about timestamp format, Paul Eggert, 2018/09/28
- Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format), Stefan Monnier, 2018/09/28
- RE: Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format), Drew Adams, 2018/09/28
- Re: Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format), Paul Eggert, 2018/09/28
- Re: Naming predicates, Stefan Monnier, 2018/09/28
- RE: Naming predicates, Drew Adams, 2018/09/28
- RE: Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format),
Drew Adams <=