Generic Function Rank (3 methods)
(
rank collection
value
)
If collection
is a set or bag that contains value
, returns the rank of
value
in the ordering defined by compare
, and a true second value. If
collection
is a map whose domain contains value
, returns the rank of
value
in the domain of the map, and a true second value. If value
is not
in the collection, the second value is false, and the first value is the rank
of the least member of the collection greater than value
(if any; otherwise
the size (for a bag, the set-size) of the collection). Note that if there are
values/keys that are unequal but equivalent to value
, an arbitrary order
will be imposed on them for this purpose; but another collection that is
equal?
but not eq
to this one will in general order them differently.
Also, on a bag, multiplicities are ignored for this purpose.
Method Summary