VocabularysequencesInputsOutputsWord descriptionOutputs a new sequence consisting of the first
n elements of the input sequence.
ExamplesUSING: sequences prettyprint ;
{ 1 2 3 4 5 6 7 } 2 head .
{ 1 2 }
When a sequence may not have enough elements:
USING: sequences prettyprint ;
{ 1 2 } 5 index-or-length head .
{ 1 2 }
ErrorsThrows an error if the index is out of bounds.
See alsohead*,
head-slice,
head-slice*Definition