{ 120000 } [ { 10 20 30 40 50 60 } 1 [ * ] 3 reduce-from ] unit-test
-{
- {
- { 2 4 }
- { 3 6 }
- { 4 8 }
- }
-} [ { 2 3 4 } [ 2 * ] map-zip ] unit-test
-
-{ }
-[ "test:" all-words [ name>> over prepend ] map-zip 2drop ] unit-test
-
{ { 0 1 2 3 } } [ 8 <iota> [ 4 < ] take-while >array ] unit-test
{ { } } [ { 15 16 } [ 4 < ] take-while >array ] unit-test
{ { 0 1 2 } } [ 3 <iota> [ 4 < ] take-while >array ] unit-test
{ SBUF" aco" SBUF" ftr" } [ SBUF" factor" dup [ even? ] extract! ] unit-test
{ 25 5 1 } [ { 4 5 6 } [ sq ] [ 20 > ] find-pred ] unit-test
-{ f f f } [ { 4 5 6 } [ sq ] [ 200 > ] find-pred ] unit-test
\ No newline at end of file
+{ f f f } [ { 4 5 6 } [ sq ] [ 200 > ] find-pred ] unit-test
: count-subseq* ( subseq seq -- n )
start-all* length ; inline
-: map-zip ( quot: ( key -- value ) -- alist )
- '[ _ keep swap ] map>alist ; inline
-
-: assoc-map-zip ( quot: ( key value -- calc ) -- alist )
+: assoc-zip-with ( quot: ( key value -- calc ) -- alist )
'[ _ 2keep 2array swap ] assoc-map ; inline
: take-while ( ... seq quot: ( ... elt -- ... ? ) -- head-slice )