sequence
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




Methods













M:: sequence (gml-put) ( collection key elt -- )
elt key collection wrap set-nth ;








































































































































































M: sequence g drop "sequence" ;









M: sequence help-coverage.
[ [ help-coverage. ] each ] [
[ [ 100%-coverage?>> ] count ] [ length ] bi /f 100 *
"\n%3.1f%% of words have complete documentation\n"
printf
] bi ; recursive