]> gitweb.factorcode.org Git - factor.git/commitdiff
remove unused word, make some stuff compile
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 5 Oct 2008 23:26:24 +0000 (18:26 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 5 Oct 2008 23:26:24 +0000 (18:26 -0500)
basis/unicode/collation/collation-tests.factor
basis/unicode/collation/collation.factor

index bf87c6b7da027a016f442ad2c832906a5116a961..be6af2d9207cab624a592765fe4fb5b44e6701e4 100644 (file)
@@ -11,11 +11,7 @@ IN: unicode.collation.tests
 : test-two ( str1 str2 -- )\r
     [ +lt+ ] -rot [ string<=> ] 2curry unit-test ;\r
 \r
-: failures\r
-    parse-test dup 2 <clumps>\r
-    [ string<=> +lt+ = not ] assoc-filter dup assoc-size ;\r
-\r
-: test-equality\r
+: test-equality ( str1 str2 -- )\r
     { primary= secondary= tertiary= quaternary= }\r
     [ execute ] with with each ;\r
 \r
index 8e9e2963a8cea0be9c49e0f2a59025d53914d755..65786ede5dcb7b43b50b9075ed5cedcb58b536e4 100644 (file)
@@ -100,8 +100,8 @@ ducet insert-helpers
     ] { } map-as concat ;\r
 \r
 : append-weights ( weights quot -- )\r
-    swap [ ignorable?>> not ] filter\r
-    swap map [ zero? not ] filter % 0 , ;\r
+    [ [ ignorable?>> not ] filter ] dip\r
+    map [ zero? not ] filter % 0 , ; inline\r
 \r
 : variable-weight ( weight -- )\r
     dup ignorable?>> [ primary>> ] [ drop HEX: FFFF ] if , ;\r
@@ -135,7 +135,7 @@ PRIVATE>
 <PRIVATE\r
 : insensitive= ( str1 str2 levels-removed -- ? )\r
     [\r
-        swap collation-key swap\r
+        [ collation-key ] dip\r
         [ [ 0 = not ] trim-right but-last ] times\r
     ] curry bi@ = ;\r
 PRIVATE>\r
@@ -158,8 +158,7 @@ PRIVATE>
 PRIVATE>\r
 \r
 : sort-strings ( strings -- sorted )\r
-    [ w/collation-key ] map\r
-    natural-sort values ;\r
+    [ w/collation-key ] map natural-sort values ;\r
 \r
 : string<=> ( str1 str2 -- <=> )\r
     [ w/collation-key ] compare ;\r