supremum-by ( ... seq quot: ( ... elt -- ... x ) -- ... elt )


Vocabulary
sequences

Inputs
seqa sequence
quota quotation


Outputs
eltan object


Word description
Outputs the greatest element of seq according to the quot.

Examples
Example:
USING: sequences prettyprint ; { { 1 2 } { 1 2 3 } { 1 2 3 4 } } [ length ] supremum-by .
{ 1 2 3 4 }


Errors
Throws an error if the sequence is empty.

See also
min, max, infimum, infimum-by, supremum

Definition


: supremum-by
( ... seq quot: ( ... elt -- ... x ) -- ... elt )
[ after? ] select-by ; inline