maximum ( seq -- elt )
Factor handbook » The language » Collections » Sequence operations » Sequence combinators

Prev:minimum-by ( ... seq quot: ( ... elt -- ... x ) -- ... elt )
Next:maximum-by ( ... seq quot: ( ... elt -- ... x ) -- ... elt )


Vocabulary
sequences

Inputs
seqa sequence


Outputs
eltan object


Word description
Outputs the greatest element of seq.

Examples
Example:
USING: sequences prettyprint ; { 1 2 3 4 5 } maximum .
5

Example:
USING: sequences prettyprint ; { "c" "b" "a" } maximum .
"c"


Errors
Throws an error if the sequence is empty.

See also
min, max, minimum, minimum-by, maximum-by

Definition


Methods