sequences.extras: adding join-with.
parent
03141d93c1
commit
58e77d10f9
|
@ -262,3 +262,7 @@ tools.test vectors vocabs ;
|
|||
{ { 4 5 6 7 } } [ 8 <iota> [ 4 < ] drop-while >array ] unit-test
|
||||
{ { 15 16 } } [ { 15 16 } [ 4 < ] drop-while >array ] unit-test
|
||||
{ { } } [ 3 <iota> [ 4 < ] drop-while >array ] unit-test
|
||||
|
||||
{ { } } [ { } ", " join-with ] unit-test
|
||||
{ { 1 } } [ { 1 } ", " join-with ] unit-test
|
||||
{ { 1 ", " 2 } } [ { 1 2 } ", " join-with ] unit-test
|
||||
|
|
|
@ -625,3 +625,8 @@ PRIVATE>
|
|||
: drop-while ( ... seq quot: ( ... elt -- ... ? ) -- tail-slice )
|
||||
[ '[ @ not ] find drop ] 2keep drop swap
|
||||
[ dup length ] unless* tail-slice ; inline
|
||||
|
||||
: join-with ( seq glue -- newseq )
|
||||
V{ } clone [
|
||||
[ '[ _ _ push ] ] [ '[ _ push ] ] bi interleave
|
||||
] keep { } like ;
|
||||
|
|
Loading…
Reference in New Issue