{ { 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
: 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 ;