release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
25
modules/core/cmp.owa
Normal file
25
modules/core/cmp.owa
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(seq
|
||||
(defmacro eq? <Bool>[]
|
||||
(if-eq ($%%) :true :false))
|
||||
(defmacro nq? <Bool>[]
|
||||
(if-eq ($%%) :false :true))
|
||||
|
||||
(fn cmp <Keyword>[left right]
|
||||
(match (builtins.cmp left right)
|
||||
(-1 :less)
|
||||
(0 :equal)
|
||||
(1 :greater)))
|
||||
|
||||
|
||||
(fn lt? <Bool>[left right]
|
||||
(eq? (cmp left right) :less))
|
||||
|
||||
(fn lte? <Bool>[left right]
|
||||
(bool.or (lt? left right) (eq? left right)))
|
||||
|
||||
(fn gt? <Bool>[left right]
|
||||
(eq? (cmp left right) :greater))
|
||||
|
||||
(fn gte? <Bool>[left right]
|
||||
(bool.or (gt? left right) (eq? left right)))
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue