splitting.monotonic: revert to previous monotonic-split (thanks @k7f!).

db4
John Benediktsson 2012-07-16 07:39:03 -07:00
parent 6955bf1428
commit e6f30668e1
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
IN: splitting.monotonic IN: splitting.monotonic
USING: tools.test math arrays kernel sequences ; USING: tools.test math arrays kernel sequences ;
{ { } } [ { } [ < ] monotonic-split ] unit-test
[ { { 1 } { -1 5 } { 2 4 } } ] [ { { 1 } { -1 5 } { 2 4 } } ]
[ { 1 -1 5 2 4 } [ < ] monotonic-split [ >array ] map ] unit-test [ { 1 -1 5 2 4 } [ < ] monotonic-split [ >array ] map ] unit-test
[ { { 1 1 1 1 } { 2 2 } { 3 } { 4 } { 5 } { 6 6 6 } } ] [ { { 1 1 1 1 } { 2 2 } { 3 } { 4 } { 5 } { 6 6 6 } } ]

View File

@ -20,7 +20,7 @@ IN: splitting.monotonic
PRIVATE> PRIVATE>
: monotonic-split ( seq quot: ( obj1 obj2 -- ? ) -- newseq ) : monotonic-split ( seq quot: ( obj1 obj2 -- ? ) -- newseq )
[ drop { } ] [ (monotonic-split) ] if-empty ; inline over empty? [ 2drop { } ] [ (monotonic-split) ] if ; inline
<PRIVATE <PRIVATE