Are there idiomatic boolean comparators in emacs lisp?
Something like:
(my/bool< nil t)
=> t
(my/bool< 1 2)
=> nil
For example, a comparator that returns t if the first argument is nil and the second is truthy (per common association of '0' with 'false' or nil). The convention isn't important; only that it is a comparator and not a simple xor function.
For example, use as a sorting predicate:
(sort '(nil t t nil t nil nil nil t)
(lambda (a b)
(and (not a) b)))
= > (nil nil nil nil nil t t t t)
(sort '(nil 1 5 nil 3 nil nil nil 2)
(lambda (a b)
(and (not a) b)))
=> (nil nil nil nil nil 1 5 3 2)