max

func max(sl : Set+List, m : Map) -> sl
  return first(sort(sl, `>=')) when m = Undefined
  return first(sort(fmap(m, sl), `>='))

Returns the element of the given set or list which is maximal under the given mapping. Returns Undefined when applied to infinite sets. For example:
  max([1 2 3]) = 3
  max({1 2 3} [20 30 10]) = 2
  max(Number) = Undefined
See also: min.
Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.