From a86a138b0858afdddb28a7f4646c0c656da41965 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 31 Oct 2007 16:03:06 -0500 Subject: [PATCH] Moved monotonic-split to sequences.lib --- extra/roman/roman-tests.factor | 4 ---- extra/roman/roman.factor | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/extra/roman/roman-tests.factor b/extra/roman/roman-tests.factor index aac7d14d90..e850411726 100644 --- a/extra/roman/roman-tests.factor +++ b/extra/roman/roman-tests.factor @@ -1,9 +1,5 @@ USING: arrays kernel math roman roman.private sequences tools.test ; -[ { { 1 } { -1 5 } { 2 4 } } ] -[ { 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 } [ = ] monotonic-split [ >array ] map ] unit-test [ "i" ] [ 1 >roman ] unit-test [ "ii" ] [ 2 >roman ] unit-test [ "iii" ] [ 3 >roman ] unit-test diff --git a/extra/roman/roman.factor b/extra/roman/roman.factor index 482d52e972..130dfb127d 100644 --- a/extra/roman/roman.factor +++ b/extra/roman/roman.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs kernel math math.vectors namespaces -quotations sequences sequences.private strings ; +quotations sequences sequences.lib sequences.private strings ; IN: roman r dup unclip add r> - v, [ pick ,, call [ v, ] unless ] curry 2each ,v - ] { } make ; - : roman<= ( ch1 ch2 -- ? ) [ 1string roman-digits index ] 2apply >= ;