]> gitweb.factorcode.org Git - factor.git/commitdiff
rename human-<=> to human<=>, same for human>=<
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 26 Jan 2009 06:32:02 +0000 (23:32 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 26 Jan 2009 06:32:02 +0000 (23:32 -0700)
basis/sorting/human/human-docs.factor
basis/sorting/human/human.factor
basis/sorting/slots/slots-tests.factor

index 5342b28317e55e0031c28965c44bd3a6252eaffb..5cd04c8090c0b759649534b6bf3ee2c428dcc12e 100644 (file)
@@ -11,19 +11,19 @@ HELP: find-numbers
 }
 { $description "Splits a string on numbers and returns a sequence of sequences and integers." } ;
 
-HELP: human-<=>
+HELP: human<=>
 { $values
      { "obj1" object } { "obj2" object }
      { "<=>" "an ordering specifier" }
 }
 { $description "Compares two objects after converting numbers in the string into integers." } ;
 
-HELP: human->=<
+HELP: human>=<
 { $values
      { "obj1" object } { "obj2" object }
      { ">=<" "an ordering specifier" }
 }
-{ $description "Compares two objects using the " { $link human-<=> } " word and inverts the result." } ;
+{ $description "Compares two objects using the " { $link human<=> } " word and inverts the result." } ;
 
 HELP: human-compare
 { $values
@@ -44,22 +44,22 @@ HELP: human-sort-keys
      { "seq" "an alist" }
      { "sortedseq" "a new sorted sequence" }
 }
-{ $description "Sorts the elements comparing first elements of pairs using the " { $link human-<=> } " word." } ;
+{ $description "Sorts the elements comparing first elements of pairs using the " { $link human<=> } " word." } ;
 
 HELP: human-sort-values
 { $values
      { "seq" "an alist" }
      { "sortedseq" "a new sorted sequence" }
 }
-{ $description "Sorts the elements comparing second elements of pairs using the " { $link human-<=> } " word." } ;
+{ $description "Sorts the elements comparing second elements of pairs using the " { $link human<=> } " word." } ;
 
 { <=> >=< human-compare human-sort human-sort-keys human-sort-values } related-words
 
 ARTICLE: "sorting.human" "sorting.human"
 "The " { $vocab-link "sorting.human" } " vocabulary sorts by numbers as a human would -- by comparing their magnitudes -- rather than in a lexicographic way. For example, sorting a1, a10, a03, a2 with human sort returns a1, a2, a03, a10, while sorting with natural sort returns a03, a1, a10, a2." $nl
 "Comparing two objects:"
-{ $subsection human-<=> }
-{ $subsection human->=< }
+{ $subsection human<=> }
+{ $subsection human>=< }
 { $subsection human-compare }
 "Sort a sequence:"
 { $subsection human-sort }
index 2c4d391a60d1c4e5429f0b2c2aefda1dfb3014b1..1c7392901b3857f394d2bc2da96c0fe2aa7f7978 100644 (file)
@@ -7,13 +7,13 @@ IN: sorting.human
 : find-numbers ( string -- seq )
     [EBNF Result = ([0-9]+ => [[ string>number ]] | (!([0-9]) .)+)* EBNF] ;
 
-: human-<=> ( obj1 obj2 -- <=> ) [ find-numbers ] bi@ <=> ;
+: human<=> ( obj1 obj2 -- <=> ) [ find-numbers ] bi@ <=> ;
 
-: human->=< ( obj1 obj2 -- >=< ) human-<=> invert-comparison ; inline
+: human>=< ( obj1 obj2 -- >=< ) human<=> invert-comparison ; inline
 
-: human-compare ( obj1 obj2 quot -- <=> ) bi@ human-<=> ;
+: human-compare ( obj1 obj2 quot -- <=> ) bi@ human<=> ;
 
-: human-sort ( seq -- seq' ) [ human-<=> ] sort ;
+: human-sort ( seq -- seq' ) [ human<=> ] sort ;
 
 : human-sort-keys ( seq -- sortedseq )
     [ [ first ] human-compare ] sort ;
index 7a4eeb8e7593cfcbf0966563eba28ee1a302bfdb..46824c6fdb17d6738a364ac0070a7a60d810c5cd 100644 (file)
@@ -41,7 +41,7 @@ TUPLE: tuple2 d ;
         T{ sort-test f 1 1 11 }
         T{ sort-test f 2 5 3 }
         T{ sort-test f 2 5 2 }
-    } { { a>> human-<=> } { b>> human->=< } { c>> <=> } } sort-by-slots
+    } { { a>> human<=> } { b>> human>=< } { c>> <=> } } sort-by-slots
 ] unit-test
 
 [
@@ -64,7 +64,7 @@ TUPLE: tuple2 d ;
         T{ sort-test f 2 5 3 }
         T{ sort-test f 2 5 2 }
     }
-    { { a>> human-<=> } { b>> <=> } } [ sort-by-slots ] keep
+    { { a>> human<=> } { b>> <=> } } [ sort-by-slots ] keep
     [ but-last-slice ] map split-by-slots [ >array ] map
 ] unit-test