sequence
Factor documentation
>
Factor handbook
>
The language
>
Collections
>
Sequence operations
>
Sequence protocol
Next:
sequence? ( object -- ? )
Vocabulary
sequences
Class description
A mixin class whose instances are sequences. Custom implementations of the sequence protocol should be declared as instances of this mixin for all sequence functionality to work correctly:
INSTANCE: my-sequence sequence
Definition
USING:
arrays
benchmark.tuple-arrays
bit-arrays
byte-arrays
game.input.dinput.keys-array
game.models.util
grouping.private
growable
math.blas.matrices
math.vectors.simd
nibble-arrays
sequences.complex
sequences.complex-components
sequences.product
specialized-arrays
strings
xml.data
;
IN:
sequences
MIXIN:
sequence
INSTANCE:
immutable-sequence
sequence
INSTANCE:
virtual-sequence
sequence
INSTANCE:
array
sequence
INSTANCE:
growable
sequence
INSTANCE:
byte-array
sequence
INSTANCE:
string
sequence
INSTANCE:
chunking
sequence
INSTANCE:
subseq-chunking
sequence
INSTANCE:
slice-chunking
sequence
INSTANCE:
abstract-groups
sequence
INSTANCE:
abstract-clumps
sequence
INSTANCE:
bit-array
sequence
INSTANCE:
specialized-array
sequence
INSTANCE:
tag
sequence
INSTANCE:
xml
sequence
INSTANCE:
xml-chunk
sequence
INSTANCE:
keys-array
sequence
INSTANCE:
blas-matrix-rowcol-sequence
sequence
INSTANCE:
product-sequence
sequence
INSTANCE:
char-16
sequence
INSTANCE:
uchar-16
sequence
INSTANCE:
short-8
sequence
INSTANCE:
ushort-8
sequence
INSTANCE:
int-4
sequence
INSTANCE:
uint-4
sequence
INSTANCE:
longlong-2
sequence
INSTANCE:
ulonglong-2
sequence
INSTANCE:
float-4
sequence
INSTANCE:
double-2
sequence
INSTANCE:
nibble-array
sequence
INSTANCE:
complex-sequence
sequence
INSTANCE:
complex-components
sequence
INSTANCE:
point-array
sequence
INSTANCE:
indexed-seq
sequence
Methods
USING:
bootstrap.image.private
kernel
sequences
;
M:
sequence
(eql?)
2dup
[
length
]
bi@
=
[
[
eql?
]
2all?
]
[
2drop
f
]
if
;
USING:
assocs
http.client.post-data.private
kernel
sequences
;
M:
sequence
(set-post-data-headers)
length
"content-length"
pick
set-at
;
USING:
http.client.post-data.private
io
sequences
;
M:
sequence
(write-post-data)
write
;
USING:
kernel
math.order
sequences
sequences.private
;
M:
sequence
<=>
2dup
mismatch
[
-rot
2nth-unsafe
<=>
]
[
[
length
]
compare
]
if*
;
USING:
accessors
kernel
mongodb.msg
sequences
;
M:
sequence
<mdb-insert-msg>
[
mdb-insert-msg
new
]
2dip
[
>>collection
]
dip
>>objects
OP_Insert
>>opcode
;
USING:
accessors
kernel
mongodb.msg
sequences
;
M:
sequence
<mdb-killcursors-msg>
[
mdb-killcursors-msg
new
]
dip
[
length
>>cursors#
]
keep
>>cursors
OP_KillCursors
>>opcode
;
inline
USING:
assocs
sequences
;
M:
sequence
>alist
;
inline
USING:
combinators
kernel
sequences
xml.syntax.private
;
M:
sequence
[undo-xml]
remove-blanks
[
length
]
[
[
[undo-xml]
]
{
}
map-as
]
bi
[
[
[
remove-blanks
]
]
dip
[
firstn-strong
]
curry
compose
]
dip
[
spread
]
curry
compose
;
USING:
assocs
kernel
sequences
;
M:
sequence
assoc-clone-like
[
>alist
]
dip
clone-like
;
inline
USING:
assocs
kernel
sequences
;
M:
sequence
assoc-like
[
>alist
]
dip
like
;
inline
USING:
assocs
sequences
;
M:
sequence
assoc-size
length
;
inline
USING:
compiler.tree.propagation.constraints
sequences
;
M:
sequence
assume*
[
assume
]
each
;
USING:
assocs
assocs.private
kernel
sequences
;
M:
sequence
at*
search-alist
[
second
t
]
[
f
]
if
;
USING:
kernel
sequences
sequences.deep
;
M:
sequence
branch?
drop
t
;
USING:
bson.constants
bson.writer.private
kernel
sequences
;
M:
sequence
bson-type?
drop
T_Array
;
USING:
bson.writer
bson.writer.private
kernel
math.parser
sequences
;
M:
sequence
bson-write
[
[
[
write-type
]
dip
number>string
write-cstring
bson-write
]
each-index
write-eoo
]
curry
with-length-prefix
;
USING:
irc.client.internals
kernel
sequences
;
M:
sequence
chat-put
[
chat-put
]
with
each
;
USING:
assocs
sequences
;
M:
sequence
clear-assoc
delete-all
;
inline
USING:
kernel
sequences
;
M:
sequence
clone-like
[
dup
length
]
dip
new-sequence
[
0
swap
copy
]
keep
;
inline
USING:
assocs
assocs.private
kernel
sequences
;
M:
sequence
delete-at
[
nip
]
[
search-alist
nip
]
2bi
[
swap
remove-nth!
drop
]
[
drop
]
if*
;
USING:
fuel.pprint
fuel.pprint.private
sequences
;
M:
sequence
fuel-pprint
"("
")"
fuel-pprint-sequence
;
inline
USING:
benchmark.dispatch3
kernel
sequences
;
M:
sequence
g
drop
"sequence"
;
USING:
combinators
kernel
sequences
;
M:
sequence
hashcode*
[
sequence-hashcode
]
recursive-hashcode
;
USING:
classes
sequences
sets
;
M:
sequence
implementors
[
implementors
]
gather
;
USING:
io
json.writer
sequences
;
M:
sequence
json-print
91
write1
[
>json
]
map
","
join
write
93
write1
;
USING:
kernel
math
sequences
;
M:
sequence
lengthen
2dup
length
>
[
set-length
]
[
2drop
]
if
;
inline
USING:
kernel
sequences
;
M:
sequence
like
drop
;
inline
USING:
assocs
kernel
sequences
vectors
;
M:
sequence
new-assoc
drop
<vector>
;
inline
USING:
kernel
persistent.sequences
sequences
;
M:
sequence
new-nth
clone
[
set-nth
]
keep
;
USING:
kernel
sequences
vectors
;
M:
sequence
new-resizable
drop
<vector>
;
inline
USING:
sequences
sequences.private
;
M:
sequence
nth
bounds-check
nth-unsafe
;
inline
USING:
sequences
sequences.private
;
M:
sequence
nth-unsafe
nth
;
inline
USING:
persistent.sequences
sequences
;
M:
sequence
ppop
1
head*
;
USING:
kernel
persistent.sequences
sequences
;
M:
sequence
ppush
swap
suffix
;
USING:
kernel
make
sequences
xml.data
xml.syntax.private
;
M:
sequence
push-item
dup
xml-data?
[
,
]
[
[
push-item
]
each
]
if
;
USING:
kernel
random
random.private
sequences
;
M:
sequence
random
[
f
]
[
[
length
random-integer
]
keep
nth
]
if-empty
;
USING:
sequences
smalltalk.selectors
;
M:
sequence
selector-at:
nth
;
USING:
kernel
sequences
smalltalk.selectors
;
M:
sequence
selector-at:put:
[
swapd
set-nth
]
keep
;
USING:
arrays
assocs
assocs.private
kernel
sequences
;
M:
sequence
set-at
2dup
search-alist
[
2nip
set-second
]
[
drop
[
swap
2array
]
dip
push
]
if
;
USING:
sequences
sequences.private
;
M:
sequence
set-nth
bounds-check
set-nth-unsafe
;
inline
USING:
sequences
sequences.private
;
M:
sequence
set-nth-unsafe
set-nth
;
inline
USING:
kernel
math
sequences
;
M:
sequence
shorten
2dup
length
<
[
set-length
]
[
2drop
]
if
;
inline
USING:
alien.strings
sequences
;
M:
sequence
string>symbol
[
string>symbol*
]
map
;
USING:
accessors
classes
kernel
make
math.parser
sequences
summary
;
M:
sequence
summary
[
dup
class
name>>
%
" with "
%
length
#
" elements"
%
]
""
make
;
USING:
classes
classes.private
generic
kernel
sequences
;
M:
sequence
update-methods
implementors
[
update-generic
]
with
each
;
USING:
db.queries
kernel
nmake
sequences
;
M:
sequence
where
[
[
" or "
0%
]
[
dupd
where
]
interleave
drop
]
in-parens
;
USING:
sequences
xml.writer
;
M:
sequence
write-xml
[
write-xml
]
each
;