sequence? ( object -- ? )
Factor documentation > Factor handbook > The language > Collections > Sequence operations > Sequence protocol
Prev:sequence
Next:length ( seq -- n )


Vocabulary
sequences

Inputs and outputs
objectan object
?a boolean


Word description
Tests if the object is an instance of the sequence class.

Definition
USING: benchmark.tuple-arrays game.models.util kernel
math.vectors.simd nibble-arrays sequences.complex
sequences.complex-components ;

IN: sequences

: sequence? ( object -- ? )
dup indexed-seq?
[ drop t ] [
dup point-array?
[ drop t ] [
dup complex-components?
[ drop t ] [
dup complex-sequence?
[ drop t ] [
dup nibble-array?
[ drop t ] [
dup double-2? ~quotation~ ~quotation~
if
] if
] if
] if
] if
] if ;