Handbook
Glossary
new-sequence ( len seq -- newseq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Sequence protocol
Prev:
like ( seq exemplar -- newseq )
Next:
new-resizable ( len seq -- newseq )
Vocabulary
sequences
Inputs
len
a non-negative integer
seq
a
sequence
Outputs
newseq
a mutable sequence
Generic word contract
Outputs a mutable sequence of length
len
which can hold the elements of
seq
. The initial contents of the sequence are undefined.
Examples
USING: prettyprint sequences ; 6 { 1 2 3 } new-sequence .
{ 0 0 0 0 0 0 }
Definition
IN:
sequences
GENERIC:
new-sequence
( len seq -- newseq )
flushable
Methods
USING:
kernel
sequences
specialized-arrays.instances.raylib.BoneInfo
;
M:
BoneInfo-array
new-sequence
drop
(BoneInfo-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf32_Phdr
;
M:
Elf32_Phdr-array
new-sequence
drop
(Elf32_Phdr-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf32_Shdr
;
M:
Elf32_Shdr-array
new-sequence
drop
(Elf32_Shdr-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf32_Sym
;
M:
Elf32_Sym-array
new-sequence
drop
(Elf32_Sym-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf64_Phdr
;
M:
Elf64_Phdr-array
new-sequence
drop
(Elf64_Phdr-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf64_Shdr
;
M:
Elf64_Shdr-array
new-sequence
drop
(Elf64_Shdr-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.elf.Elf64_Sym
;
M:
Elf64_Sym-array
new-sequence
drop
(Elf64_Sym-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.Material
;
M:
Material-array
new-sequence
drop
(Material-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.MaterialMap
;
M:
MaterialMap-array
new-sequence
drop
(MaterialMap-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.Matrix
;
M:
Matrix-array
new-sequence
drop
(Matrix-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.Mesh
;
M:
Mesh-array
new-sequence
drop
(Mesh-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.Vector2
;
M:
Vector2-array
new-sequence
drop
(Vector2-array)
;
inline
USING:
classes.struct
kernel
raylib
sequences
;
M:
Vector2
new-sequence
over
2
=
[
2drop
Vector2
(struct)
]
[
invalid-vector-length
]
if
;
inline
USING:
kernel
sequences
specialized-arrays.instances.raylib.Vector3
;
M:
Vector3-array
new-sequence
drop
(Vector3-array)
;
inline
USING:
classes.struct
kernel
raylib
sequences
;
M:
Vector3
new-sequence
over
3
=
[
2drop
Vector3
(struct)
]
[
invalid-vector-length
]
if
;
inline
USING:
classes.struct
kernel
raylib
sequences
;
M:
Vector4
new-sequence
over
4
=
[
2drop
Vector4
(struct)
]
[
invalid-vector-length
]
if
;
inline
USING:
accessors
math
sequences
sequences.inserters
;
M::
appender
new-sequence
( len inserter -- newseq )
inserter
underlying>>
:>
underlying underlying
length
:>
old-length old-length len
+
:>
new-length new-length underlying
set-length
underlying old-length
<offset-growable>
;
inline
USING:
bit-arrays
kernel
sequences
;
M:
bit-array
new-sequence
drop
<bit-array>
;
inline
USING:
bit-arrays
bit-vectors
kernel
math
sequences
;
M:
bit-vector
new-sequence
drop
[
<bit-array>
]
[
>fixnum
]
bi
bit-vector
boa
;
inline
USING:
kernel
sequences
specialized-arrays.instances.benchmark.nbody-simd.body
;
M:
body-array
new-sequence
drop
(body-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.gpu.demos.bunny.bunny-vertex-struct
;
M:
bunny-vertex-struct-array
new-sequence
drop
(bunny-vertex-struct-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.gpu.demos.bunny.bunny-vertex-struct
specialized-vectors.instances.gpu.demos.bunny.bunny-vertex-struct
;
M:
bunny-vertex-struct-vector
new-sequence
drop
[
<bunny-vertex-struct-array>
]
[
>fixnum
]
bi
bunny-vertex-struct-vector
boa
;
inline
USING:
byte-arrays
kernel
sequences
;
M:
byte-array
new-sequence
drop
(byte-array)
;
inline
USING:
byte-arrays
byte-vectors
kernel
math
sequences
;
M:
byte-vector
new-sequence
drop
[
(byte-array)
]
[
>fixnum
]
bi
byte-vector
boa
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.c-string
;
M:
c-string-array
new-sequence
drop
(c-string-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
char-32
new-sequence
2drop
16
char-16
new
new-sequence
16
char-16
new
new-sequence
\
char-32
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.char
;
M:
char-array
new-sequence
drop
(char-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.complex.complex-double
;
M:
complex-double-array
new-sequence
drop
(complex-double-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.complex.complex-float
;
M:
complex-float-array
new-sequence
drop
(complex-float-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.chipmunk.ffi.cpContact
;
M:
cpContact-array
new-sequence
drop
(cpContact-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.chipmunk.ffi.cpPolyShapeAxis
;
M:
cpPolyShapeAxis-array
new-sequence
drop
(cpPolyShapeAxis-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.chipmunk.ffi.cpVect
;
M:
cpVect-array
new-sequence
drop
(cpVect-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.math.vectors.simd.cords.double-4
;
M:
double-4-array
new-sequence
drop
(double-4-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
double-4
new-sequence
2drop
2
double-2
new
new-sequence
2
double-2
new
new-sequence
\
double-4
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.double
;
M:
double-array
new-sequence
drop
(double-array)
;
inline
USING:
arrays
kernel
math
sequences
;
M:
f
new-sequence
drop
[
f
]
[
0
<array>
]
if-zero
;
inline
USING:
kernel
sequences
specialized-arrays.instances.macho.fat_arch
;
M:
fat_arch-array
new-sequence
drop
(fat_arch-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.fftw.ffi.fftw_complex
;
M:
fftw_complex-array
new-sequence
drop
(fftw_complex-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.math.vectors.simd.float-4
;
M:
float-4-array
new-sequence
drop
(float-4-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.math.vectors.simd.float-4
specialized-vectors.instances.math.vectors.simd.float-4
;
M:
float-4-vector
new-sequence
drop
[
<float-4-array>
]
[
>fixnum
]
bi
float-4-vector
boa
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
float-8
new-sequence
2drop
4
float-4
new
new-sequence
4
float-4
new
new-sequence
\
float-8
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.float
;
M:
float-array
new-sequence
drop
(float-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.game.loop.benchmark.game-loop-benchmark
;
M:
game-loop-benchmark-array
new-sequence
drop
(game-loop-benchmark-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.game.loop.benchmark.game-loop-benchmark
specialized-vectors.instances.game.loop.benchmark.game-loop-benchmark
;
M:
game-loop-benchmark-vector
new-sequence
drop
[
<game-loop-benchmark-array>
]
[
>fixnum
]
bi
game-loop-benchmark-vector
boa
;
inline
USING:
kernel
sequences
specialized-arrays.instances.math.floats.half.half
;
M:
half-array
new-sequence
drop
(half-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
int-8
new-sequence
2drop
4
int-4
new
new-sequence
4
int-4
new
new-sequence
\
int-8
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.int
;
M:
int-array
new-sequence
drop
(int-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.int32_t
;
M:
int32_t-array
new-sequence
drop
(int32_t-array)
;
inline
USING:
accessors
sequences
sequences.interleaved
;
M:
interleaved
new-sequence
seq>>
new-sequence
;
USING:
kernel
sequences
specialized-arrays.instances.io.files.acls.macos.ffi.kauth_ace
;
M:
kauth_ace-array
new-sequence
drop
(kauth_ace-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.unix.kqueue.kevent
;
M:
kevent-array
new-sequence
drop
(kevent-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.libusb.libusb_iso_packet_descriptor
;
M:
libusb_iso_packet_descriptor-array
new-sequence
drop
(libusb_iso_packet_descriptor-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.long
;
M:
long-array
new-sequence
drop
(long-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
longlong-4
new-sequence
2drop
2
longlong-2
new
new-sequence
2
longlong-2
new
new-sequence
\
longlong-4
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.longlong
;
M:
longlong-array
new-sequence
drop
(longlong-array)
;
inline
USING:
classes.struct
kernel
math.matrices.simd
sequences
;
M:
matrix4
new-sequence
2drop
matrix4
(struct)
;
inline
USING:
kernel
nibble-arrays
sequences
;
M:
nibble-array
new-sequence
drop
<nibble-array>
;
USING:
kernel
sequences
specialized-arrays.instances.macho.nlist
;
M:
nlist-array
new-sequence
drop
(nlist-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.macho.nlist_64
;
M:
nlist_64-array
new-sequence
drop
(nlist_64-array)
;
inline
USING:
arrays
kernel
sequences
;
M:
object
new-sequence
drop
0
<array>
;
inline
USING:
kernel
sequences
specialized-arrays.instances.papier.map.papier-vertex-struct
;
M:
papier-vertex-struct-array
new-sequence
drop
(papier-vertex-struct-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.fluids.particle_t
;
M:
particle_t-array
new-sequence
drop
(particle_t-array)
;
inline
USING:
benchmark.tuple-arrays
kernel
sequences
;
M:
point-array
new-sequence
drop
<point-array>
;
inline
USING:
kernel
sequences
specialized-arrays.instances.benchmark.struct-arrays.point
;
M:
point-array
new-sequence
drop
(point-array)
;
inline
USING:
arrays
gml.types
kernel
sequences
;
M:
proc
new-sequence
drop
0
<array>
{
}
<proc>
;
USING:
accessors
kernel
sequences
sequences.inserters
;
M:
replacer
new-sequence
underlying>>
[
set-length
]
keep
;
inline
USING:
kernel
sequences
specialized-arrays.instances.rlgl.rlDrawCall
;
M:
rlDrawCall-array
new-sequence
drop
(rlDrawCall-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.rlgl.rlVertexBuffer
;
M:
rlVertexBuffer-array
new-sequence
drop
(rlVertexBuffer-array)
;
inline
USING:
kernel
math
sbufs
sequences
strings
;
M:
sbuf
new-sequence
drop
[
0
<string>
]
[
integer>fixnum
]
bi
sbuf
boa
;
inline
USING:
kernel
sequences
specialized-arrays.instances.macho.section
;
M:
section-array
new-sequence
drop
(section-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.macho.section_64
;
M:
section_64-array
new-sequence
drop
(section_64-array)
;
inline
USING:
accessors
sequences
sequences.shifted
;
M:
shifted
new-sequence
underlying>>
new-sequence
;
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
short-16
new-sequence
2drop
8
short-8
new
new-sequence
8
short-8
new
new-sequence
\
short-16
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.short
;
M:
short-array
new-sequence
drop
(short-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.alien.c-types.short
specialized-vectors.instances.alien.c-types.short
;
M:
short-vector
new-sequence
drop
[
<short-array>
]
[
>fixnum
]
bi
short-vector
boa
;
inline
USING:
byte-arrays
kernel
math.vectors.simd
math.vectors.simd.private
sequences
;
M:
simd-128
new-sequence
2dup
length
=
[
nip
[
16
(byte-array)
]
make-underlying
]
[
length
bad-simd-length
]
if
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.size_t
;
M:
size_t-array
new-sequence
drop
(size_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.unix.statfs.macos.statfs64
;
M:
statfs64-array
new-sequence
drop
(statfs64-array)
;
inline
USING:
kernel
sequences
strings
;
M:
string
new-sequence
drop
0
<string>
;
inline
USING:
accessors
kernel
sequences
xml.data
;
M:
tag
new-sequence
[
children>>
]
call
\
new-sequence
execute
;
USING:
accessors
arrays
kernel
sequences
tensors
;
M:
tensor
new-sequence
shape>>
2dup
product
=
[
nip
(tensor)
]
[
drop
1array
(tensor)
]
if
;
USING:
kernel
sequences
specialized-arrays.instances.ogg.theora.th-quant-ranges
;
M:
th-quant-ranges-array
new-sequence
drop
(th-quant-ranges-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.unix.time.timeval
;
M:
timeval-array
new-sequence
drop
(timeval-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.u16
;
M:
u16-array
new-sequence
drop
(u16-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.u32
;
M:
u32-array
new-sequence
drop
(u32-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.u64
;
M:
u64-array
new-sequence
drop
(u64-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.u8
;
M:
u8-array
new-sequence
drop
(u8-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.math.vectors.simd.uchar-16
;
M:
uchar-16-array
new-sequence
drop
(uchar-16-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
uchar-32
new-sequence
2drop
16
uchar-16
new
new-sequence
16
uchar-16
new
new-sequence
\
uchar-32
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uchar
;
M:
uchar-array
new-sequence
drop
(uchar-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.math.vectors.simd.uint-4
;
M:
uint-4-array
new-sequence
drop
(uint-4-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
uint-8
new-sequence
2drop
4
uint-4
new
new-sequence
4
uint-4
new
new-sequence
\
uint-8
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uint
;
M:
uint-array
new-sequence
drop
(uint-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.alien.c-types.uint
specialized-vectors.instances.alien.c-types.uint
;
M:
uint-vector
new-sequence
drop
[
<uint-array>
]
[
>fixnum
]
bi
uint-vector
boa
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uint16_t
;
M:
uint16_t-array
new-sequence
drop
(uint16_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uint32_t
;
M:
uint32_t-array
new-sequence
drop
(uint32_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uint64_t
;
M:
uint64_t-array
new-sequence
drop
(uint64_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uint8_t
;
M:
uint8_t-array
new-sequence
drop
(uint8_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.uintptr_t
;
M:
uintptr_t-array
new-sequence
drop
(uintptr_t-array)
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.ulong
;
M:
ulong-array
new-sequence
drop
(ulong-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
ulonglong-4
new-sequence
2drop
2
ulonglong-2
new
new-sequence
2
ulonglong-2
new
new-sequence
\
ulonglong-4
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.ulonglong
;
M:
ulonglong-array
new-sequence
drop
(ulonglong-array)
;
inline
USING:
kernel
math.vectors.simd
math.vectors.simd.cords
sequences
;
M:
ushort-16
new-sequence
2drop
8
ushort-8
new
new-sequence
8
ushort-8
new
new-sequence
\
ushort-16
boa
;
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.ushort
;
M:
ushort-array
new-sequence
drop
(ushort-array)
;
inline
USING:
kernel
math
sequences
specialized-arrays.instances.alien.c-types.ushort
specialized-vectors.instances.alien.c-types.ushort
;
M:
ushort-vector
new-sequence
drop
[
<ushort-array>
]
[
>fixnum
]
bi
ushort-vector
boa
;
inline
USING:
arrays
kernel
math
sequences
vectors
;
M:
vector
new-sequence
drop
[
f
<array>
]
[
integer>fixnum
]
bi
vector
boa
;
inline
USING:
sequences
;
M:
virtual-sequence
new-sequence
virtual-exemplar
new-sequence
;
inline
USING:
kernel
sequences
specialized-arrays.instances.alien.c-types.void*
;
M:
void*-array
new-sequence
drop
(void*-array)
;
inline
USING:
accessors
kernel
sequences
xml.data
;
M:
xml-chunk
new-sequence
[
seq>>
]
call
\
new-sequence
execute
;
USING:
accessors
kernel
sequences
xml.data
;
M:
xml
new-sequence
[
body>>
]
call
\
new-sequence
execute
;