There are many elisp functions for comparisons. The "less than" sign
< is a mathematical sign to compare inequality. Elisp has the
< to compare Number or Marker.
(< 1 2) t (< 2 1) nil
It is obvious enough that no explanation is needed.
String Less Than
Elisp also has a "less than" function for Strings, called
(string-lessp "abc" "def") t (string-lessp "abc" "ab") nil
It is a predicate function, meaning that it returns
t if the first
string, "abc" in the first example, is less than the second strings
Elisp have a convention, as noted in elisp info, to end a predicate
function with letter "p". Thus, following this convention,
string-lessp ends with "p".
Elisp does have
string< as an alias for
string-lessp. So that you
can write the above example:
(string< "abc" "def") t (string< "abc" "ab") nil
"<" vs "p" vs "-p"
It seems like a majority of "less than" functions follow this "lessp"
convention, however, there are other functions in Emacs. Here is an
incomplete list of "less than" functions I have got from my Emacs with
M-x apropos <$\|lessp$\|less-p$.
What functions do you have in your Emacs?
Incomplete List of "less than" functions