Next: srfi comparators misc, Previous: srfi comparators ternary, Up: srfi comparators [Index]
Analogous to min
and max
. Apply the comparison procedure
of comparator to the arguments to find and return a minimal (or
maximal) object. The order in which the values are compared is
unspecified.
NOTE The SRFI-67 procedures
pairwise-not=?
andkth-largest
involve sorting their arguments, and are not provided by this proposal in order to avoid an otherwise unnecessary implementation dependency. They are easily provided by a sorting package that makes use of comparators.
Usage examples:
(import (vicare) (srfi :114)) (comparator-min C 0) ⇒ 0 (comparator-min C 0 0) ⇒ 0 (comparator-min C 0 1) ⇒ 0 (comparator-min C 1 0) ⇒ 0 (comparator-min C 0 1 2) ⇒ 0