接口gen:Ord
接口
gen:Ord
最小实现ord:compare。
valueOrdering : (or/c 'eq 'lt 'gt)
value
Ordering : (or/c 'eq 'lt 'gt)
procedure(ord:compare a b) → Ordering a : Ord? b : Ord?
procedure(ord:compare a b) → Ordering
procedure
(ord:compare a b) → Ordering
procedure(Ord? a) → boolean? a : any/c
procedure(Ord? a) → boolean?
(Ord? a) → boolean?
procedure(compare a b) → Ordering a : Ord? b : Ord?
procedure(compare a b) → Ordering
(compare a b) → Ordering
> (compare 1 1)'eq> (compare "hello" "Hello")'gt> (compare (list 1 2) (list 1 2 3))'lt
'eq
'gt
'lt
procedure(> a b) → boolean? a : Ord? b : Ord?(>= a b) → boolean? a : Ord? b : Ord?(< a b) → boolean? a : Ord? b : Ord?(<= a b) → boolean? a : Ord? b : Ord?
procedure(> a b) → boolean?
(> a b) → boolean?
> (> 1 2)#f> (>= 2 1)#t> (< (list 1 2) (list 2 1))#t> (<= (hash) (hash))#t
#f
#t
procedure(min a b) → (or/c a b) a : Ord? b : Ord?(max a b) → (or/c a b) a : Ord? b : Ord?
procedure(min a b) → (or/c a b)
(min a b) → (or/c a b)
> (max 1 1)1> (min #\A #\B)#\A
1
#\A