emacs-devel
[Top][All Lists]
Advanced

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

Re: master 71783e9: Add the string-numeric-lessp function


From: Johan Bockgård
Subject: Re: master 71783e9: Add the string-numeric-lessp function
Date: Mon, 07 Mar 2016 22:14:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Drew Adams <address@hidden> writes:

> `string-numeric-lessp' really should follow the Emacs
> convention and be called `string-numeric-less-p'.
>
> It's not because `string-less-p' is misnamed that we
> should add to this mistake.  `time-less-p' is correctly
> named, for example.
>
> Or else the rule should be clarified to incorporate
> `-lessp' exceptions, so they are within, and not outside,
> the rule.

I think the rule in the Emacs Lisp manual is too simplistic. In practice
we seem to follow something closer to this rule:


   By convention, the names of predicates usually end in the letter p
   (which stands for ``predicate''). Common Lisp uses a uniform
   convention in hyphenating names of predicates. If the name of the
   predicate is formed by adding a p to an existing name, such as the
   name of a data type, a hyphen is placed before the final p if and
   only if there is a hyphen in the existing name. For example, number
   begets numberp but standard-char begets standard-char-p. On the other
   hand, if the name of a predicate is formed by adding a prefixing
   qualifier to the front of an existing predicate name, the two names
   are joined with a hyphen and the presence or absence of a hyphen
   before the final p is not changed. For example, the predicate
   string-lessp has no hyphen before the p because it is the string
   version of lessp (a MacLisp function that has been renamed < in
   Common Lisp). The name string-less-p would incorrectly imply that it
   is a predicate that tests for a kind of object called a string-less,
   and the name stringlessp would connote a predicate that tests whether
   something has no strings (is ``stringless'')!

from CLTL, https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node69.html



reply via email to

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