]> gitweb.factorcode.org Git - factor.git/commitdiff
math.order: cleanup stack effects.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Sep 2012 16:36:09 +0000 (09:36 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 14 Sep 2012 16:36:09 +0000 (09:36 -0700)
core/math/order/order-docs.factor
core/math/order/order.factor

index 4c5bc381cc14f9c6932cf4cb395451428cc9cd4e..efce6c357095ad2148c2ce7c7b7279c652f5db05 100644 (file)
@@ -31,8 +31,7 @@ HELP: +gt+
 { $description "Output by " { $link <=> } " when the first object is strictly greater than the second object." } ;
 
 HELP: invert-comparison
-{ $values { "<=>" symbol }
-          { "<=>'" symbol } }
+{ $values { "<=>" symbol } { ">=<" symbol } }
 { $description "Invert the comparison symbol returned by " { $link <=> } "." }
 { $examples
     { $example "USING: math.order prettyprint ;" "+lt+ invert-comparison ." "+gt+" } } ;
index b39b81ba2f580ee6114b0ef76bf312c3d11a3c4b..4598d19d353b7856f8d011613b9be08d7a188a32 100644 (file)
@@ -7,7 +7,7 @@ SYMBOL: +lt+
 SYMBOL: +eq+
 SYMBOL: +gt+
 
-: invert-comparison ( <=> -- <=>' )
+: invert-comparison ( <=> -- >=< )
     #! Can't use case, index or nth here
     dup +lt+ eq? [ drop +gt+ ] [ +eq+ eq? +eq+ +lt+ ? ] if ;
 
@@ -19,10 +19,10 @@ GENERIC: <=> ( obj1 obj2 -- <=> )
 
 ! Defining a math generic for comparison forces a single math
 ! promotion, and speeds up comparisons on numbers.
-: (real<=>) ( x y -- ? )
+: (real<=>) ( x y -- <=> )
     2dup < [ 2drop +lt+ ] [ number= +eq+ +gt+ ? ] if ; inline
 
-MATH: real<=> ( x y -- ? )
+MATH: real<=> ( x y -- <=> )
 M: fixnum real<=> { fixnum fixnum } declare (real<=>) ; inline
 M: bignum real<=> { bignum bignum } declare (real<=>) ; inline
 M: float real<=> { float float } declare (real<=>) ; inline