math.order: make it more obvious this is a real<=>.
parent
474913646f
commit
2a1fbb3396
|
@ -17,20 +17,20 @@ GENERIC: <=> ( obj1 obj2 -- <=> )
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
! defining a math generic for comparison forces a single math
|
! Defining a math generic for comparison forces a single math
|
||||||
! promotion, and speeds up comparisons on numbers.
|
! promotion, and speeds up comparisons on numbers.
|
||||||
: (number<=>) ( x y -- ? )
|
: (real<=>) ( x y -- ? )
|
||||||
2dup < [ 2drop +lt+ ] [ number= +eq+ +gt+ ? ] if ; inline
|
2dup < [ 2drop +lt+ ] [ number= +eq+ +gt+ ? ] if ; inline
|
||||||
|
|
||||||
MATH: number<=> ( x y -- ? )
|
MATH: real<=> ( x y -- ? )
|
||||||
M: fixnum number<=> { fixnum fixnum } declare (number<=>) ; inline
|
M: fixnum real<=> { fixnum fixnum } declare (real<=>) ; inline
|
||||||
M: bignum number<=> { bignum bignum } declare (number<=>) ; inline
|
M: bignum real<=> { bignum bignum } declare (real<=>) ; inline
|
||||||
M: float number<=> { float float } declare (number<=>) ; inline
|
M: float real<=> { float float } declare (real<=>) ; inline
|
||||||
M: real number<=> (number<=>) ; inline
|
M: real real<=> (real<=>) ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
M: real <=> number<=> ; inline
|
M: real <=> real<=> ; inline
|
||||||
|
|
||||||
GENERIC: before? ( obj1 obj2 -- ? )
|
GENERIC: before? ( obj1 obj2 -- ? )
|
||||||
GENERIC: after? ( obj1 obj2 -- ? )
|
GENERIC: after? ( obj1 obj2 -- ? )
|
||||||
|
|
Loading…
Reference in New Issue