|
From: | Paul Eggert |
Subject: | Re: Naming predicates (was: master d0c77a1: Remove some assumptions about timestamp format) |
Date: | Fri, 28 Sep 2018 12:12:45 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 9/28/18 11:28 AM, Drew Adams wrote:
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:
indivisible-p interactive-p ring-p registerv-p and lots more counterexamples the other way:bool-vector-subsetp coding-system-lessp default-boundp file-attributes-lessp hack-one-local-variable-eval-safep ...
Plus lots more symbols taken from Common Lisp, like cl-equalp.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.
[Prev in Thread] | Current Thread | [Next in Thread] |