Handbook
Glossary
before? ( obj1 obj2 -- ? )
Factor handbook
»
The language
»
Objects
»
Linear order protocol
Prev:
after? ( obj1 obj2 -- ? )
Next:
after=? ( obj1 obj2 -- ? )
Vocabulary
math
.
order
Inputs
obj1
an
object
obj2
an
object
Outputs
?
a
boolean
Word description
Tests if
obj1
comes before
obj2
using an intrinsic total order.
Notes
Implemented using
<=>
.
See also
after?
,
before=?
,
after=?
Definition
IN:
math.order
GENERIC:
before?
( obj1 obj2 -- ? )
Methods
USING:
accessors
decimals
kernel
math
math.order
;
M:
decimal
before?
guard-decimals
scale-decimals
[
mantissa>>
]
bi@
<
;
USING:
kernel
math.order
;
M:
object
before?
<=>
+lt+
eq?
;
inline
USING:
math
math.order
;
M:
real
before?
<
;
inline