sequences.extras vocabulary
Factor handbook > Vocabulary index


Summary
Contains sequence operations that are not commonly needed. Most of these words are elaborations on functions already available in the main sequences vocabulary.

Meta-data
Tags:sequences


Words

Tuple classes
ClassSuperclassSlots
evens tupleseq length
odds tupleseq length
slices-don't-touch tupleslice1 slice2
underlying-mismatch tupleslice1 slice2


Ordinary words
WordStack effect
(start-all)( subseq seq increment -- indices )
2count( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... n )
2each-index( ... seq1 seq2 quot: ( ... elt1 elt2 index -- ... ) -- ... )
2map!( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... newelt ) -- ... seq1 )
2map-index( ... seq1 seq2 quot: ( ... elt1 elt2 index -- ... newelt ) -- ... newseq )
2map-into( seq1 seq2 quot into -- )
2map-sum( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... n ) -- ... n )
<evens>( seq -- evens )
<odds>( seq -- odds )
>resizable( seq -- accum )
?<slice>( from/f to/f sequence -- slice )
?first2( seq -- first/f second/f )
?first3( seq -- first/f second/f third/f )
?first4( seq -- first/f second/f third/f fourth/f )
?span-slices( slice1/f slice2/f -- slice )
?trim( seq quot: ( elt -- ? ) -- seq/newseq )
?trim-head( seq quot: ( elt -- ? ) -- seq/newseq )
?trim-tail( seq quot: ( elt -- ? ) -- seq/newseq )
all-longest( seqs -- seqs' )
all-rotations( seq -- seq' )
all-shortest( seqs -- seqs' )
all-subseqs( seq -- seqs )
appender( quot -- appender accum )
appender-for( quot exemplar -- appender accum )
arg-max( seq -- n )
arg-min( seq -- n )
arg-sort( seq -- indices )
arg-where( ... seq quot: ( ... elt -- ... ? ) -- ... indices )
change-last( seq quot -- )
change-last-unsafe( seq quot -- )
change-nths( ... indices seq quot: ( ... elt -- ... elt' ) -- ... )
collapse( ... seq quot: ( ... elt -- ... ? ) elt -- ... seq' )
combos( list1 list2 -- result )
compact( ... seq quot: ( ... elt -- ... ? ) elt -- ... seq' )
count*( ... seq quot: ( ... elt -- ... ? ) -- ... % )
count-subseq( subseq seq -- n )
count-subseq*( subseq seq -- n )
cut-slice*( seq n -- before after )
cut-when( ... seq quot: ( ... elt -- ... ? ) -- ... before after )
each-index-from( ... seq quot: ( ... elt index -- ... ) i -- ... )
each-subseq( ... seq quot: ( ... x -- ... ) -- ... )
ensure-same-underlying( slice1 slice2 -- slice1 slice2 )
even-indices( seq -- seq' )
filter-all-subseqs( ... seq quot: ( ... x -- ... ) -- seq )
filter-all-subseqs-range( ... seq range quot: ( ... x -- ... ) -- seq )
filter-index( ... seq quot: ( ... elt i -- ... ? ) -- ... seq' )
filter-index-as( ... seq quot: ( ... elt i -- ... ? ) exemplar -- ... seq' )
filter-length( seq n -- seq' )
filter-map( ... seq filter-quot: ( ... elt -- ... ? ) map-quot: ( ... elt -- ... newelt ) -- ... newseq )
filter-map-as( ... seq filter-quot: ( ... elt -- ... ? ) map-quot: ( ... elt -- ... newelt ) exemplar -- ... newseq )
find-all( seq quot: ( elt -- ? ) -- elts )
find-last-index( ... seq quot: ( ... elt i -- ... ? ) -- ... i elt )
first=( seq elt -- ? )
first?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
flatten1( obj -- seq )
fourth=( seq elt -- ? )
fourth?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
harvest!( seq -- newseq )
harvest-as( seq exemplar -- newseq )
head*-as( seq n exemplar -- seq' )
head-as( seq n exemplar -- seq' )
index-selector( quot -- selector accum )
index-selector-as( quot exemplar -- selector accum )
infimum-by*( ... seq quot: ( ... elt -- ... x ) -- ... i elt )
insert-nth!( elt n seq -- )
last=( seq elt -- ? )
last?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
longest-subseq( seq1 seq2 -- subseq )
loop>array( quot -- seq )
loop>sequence( quot exemplar -- seq )
map-concat( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
map-concat-as( ... seq quot: ( ... elt -- ... newelt ) exemplar -- ... newseq )
map-filter( ... seq map-quot: ( ... elt -- ... newelt ) filter-quot: ( ... newelt -- ... ? ) -- ... subseq )
map-filter-as( ... seq map-quot: ( ... elt -- ... newelt ) filter-quot: ( ... newelt -- ... ? ) exemplar -- ... subseq )
map-find-index( ... seq quot: ( ... elt index -- ... result/f ) -- ... result i elt )
map-find-last-index( ... seq quot: ( ... elt index -- ... result/f ) -- ... result i elt )
map-from( ... seq quot: ( ... elt -- ... newelt ) i -- ... newseq )
map-from-as( ... seq quot: ( ... elt -- ... newelt ) i exemplar -- ... newseq )
map-harvest( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
map-index!( ... seq quot: ( ... elt index -- ... newelt ) -- ... seq )
map-keys( assoc quot: ( key -- key' ) -- assoc )
map-like( seq exemplar -- seq' )
map-product( ... seq quot: ( ... elt -- ... n ) -- ... n )
map-sift( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
map-values( assoc quot: ( value -- value' ) -- assoc )
map-zip( quot: ( x -- y ) -- alist )
merge-slices( slice1 slice2 -- slice/* )
none?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
nth*( n seq -- elt )
nth=( n seq elt -- ? )
nth?( ... n seq quot: ( ... elt -- ... ? ) -- ... ? )
odd-indices( seq -- seq' )
one?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
ordered-slices-overlap?( slice-lt slice-gt -- ? )
ordered-slices-range( slice-lt slice-gt -- to from )
ordered-slices-touch?( slice-lt slice-gt -- ? )
pad-center( seq n elt -- padded )
pad-longest( seq1 seq2 elt -- seq1 seq2 )
push-if*( ..a elt quot: ( ..a elt -- ..b obj/f ) accum -- ..b )
push-if-index( ..a elt i quot: ( ..a elt i -- ..b ? ) accum -- ..b )
reduce*( seq identity quot: ( prev elt -- next ) -- result )
reduce-from( ... seq identity quot: ( ... prev elt -- ... next ) i -- ... result )
reduce-r( seq identity quot: ( obj1 obj2 -- obj ) -- result )
reduce1( seq quot -- result )
remove-first( obj seq -- seq' )
remove-first!( obj seq -- seq )
remove-last( obj seq -- seq' )
remove-last!( obj seq -- seq )
replicate-into( ... seq quot: ( ... -- ... newelt ) -- ... )
reverse-as( seq exemplar -- newseq )
rotate( seq n -- seq' )
rotate!( seq n -- )
round-robin( seq -- newseq )
safe-subseq( from to seq -- subseq )
second=( seq elt -- ? )
second?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
selector*( quot -- selector accum )
selector-as*( quot exemplar -- selector accum )
sequence>slice( sequence -- slice )
set-nths( value indices seq -- )
set-nths-unsafe( value indices seq -- )
sift!( seq -- newseq )
sift-as( seq exemplar -- newseq )
slice-order-by-from( slice1 slice2 -- slice-lt slice-gt )
slice-when( seq quot: ( elt -- ? ) -- seq' )
slices-don't-touch( slice1 slice2 -- * )
slices-overlap?( slice1 slice2 -- ? )
slices-touch?( slice1 slice2 -- ? )
span-slices( slice1 slice2 -- slice )
start-all( subseq seq -- indices )
start-all*( subseq seq -- indices )
subseq*( from to seq -- subseq )
supremum-by*( ... seq quot: ( ... elt -- ... x ) -- ... i elt )
tail*-as( seq n exemplar -- seq' )
tail-as( seq n exemplar -- seq' )
third=( seq elt -- ? )
third?( ... seq quot: ( ... elt -- ... ? ) -- ... ? )
trim-as( ... seq quot: ( ... elt -- ... ? ) exemplar -- ... newseq )
underlying-mismatch( slice1 slice2 -- * )
unordered-slices-overlap?( slice1 slice2 -- ? )
unordered-slices-range( slice1 slice2 -- to from )
unordered-slices-touch?( slice1 slice2 -- ? )
unsurround( newseq seq2 seq3 -- seq1 )
until-empty( seq quot -- )


Class predicate words
WordStack effect
evens?( object -- ? )
odds?( object -- ? )
slices-don't-touch?( object -- ? )
underlying-mismatch?( object -- ? )


Files


Children
VocabularySummary
sequences.extras.privatesequences.extras.private vocabulary