Handbook
Glossary
direct-head ( seq n -- seq' )
Factor handbook
»
The language
»
Collections
»
Specialized arrays
»
Specialized array words
Prev:
direct-slice ( from to seq -- seq' )
Next:
direct-tail ( seq n -- seq' )
Vocabulary
specialized-arrays
Inputs
seq
a specialized array
n
an
integer
Outputs
seq'
a new specialized array
Word description
Constructs a new specialized array of the same type as
seq
sharing the same underlying memory as the first
n
elements of
seq
. Like
head
, raises an error if
n
is out of bounds.
See also
direct-slice
,
direct-tail
,
direct-head*
,
direct-tail*
Definition
USING:
sequences.private
;
IN:
specialized-arrays
:
direct-head
( seq n -- seq' )
head-to-index
direct-slice
;
inline