take

Returns elements from either end of a sequence.  If k >= 0 return a new sequence consisting of the first k elements of seq, otherwise return a new sequence consisting of the last k elements of seq.  For example:

take(#(0, 5, 10, 15, 20, 25, 30), 5)  ⇒ #(0, 5, 10, 15, 20, 25)
take(#(0, 3, 6, 9, 12, 15, 18), -3) ⇒ #(12, 15, 18)

Exported from

Modifiers

open

Arguments

seqAn instance of <sequence>.
kAn instance of <integer>.

Values

new-sequenceAn instance of <sequence>.
Sequence-Utilities, written by Matthias Hölzl, provides common or oft-used operations performed on <sequence>s.
The class of collections whose keys are consecutive integers starting from zero.
The class of integers.