Accessing sequence elements - Factor Documentation (original) (raw)
Accessing sequence elements
Factor handbook » The language » Collections » Sequence operations
Prev: | The f object as a sequence |
---|---|
Next: | Sequence combinators |
Element access by index, without raising exceptions: ?nth ( n seq -- elt/f )
Concise way of extracting one of the first four elements:
second ( seq -- second )
third ( seq -- third )
fourth ( seq -- fourth )
?first ( seq -- elt/f )
?second ( seq -- elt/f )
first2 ( seq -- first second )
first3 ( seq -- first second third )
first4 ( seq -- first second third fourth )
last2 ( seq -- penultimate ultimate )
See also
nth