Skip to content

Commit

Permalink
implement not or and natively
Browse files Browse the repository at this point in the history
also removed unnecessary inline attributes
  • Loading branch information
YarinHeffes authored and stylewarning committed Feb 11, 2025
1 parent b8a05e7 commit f801f76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion library/boolean.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
(cl:eq x y))))

(define-instance (Ord Boolean)
(inline)
(define (<=> x y)
(match x
((True)
Expand Down
16 changes: 6 additions & 10 deletions library/builtin.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
(cl:error ,datum ,@arguments)))

(coalton-toplevel
(inline)
(define (undefined _)
"A function which can be used in place of any value, throwing an error at runtime."
(error "Undefined"))
Expand All @@ -47,25 +46,22 @@
(declare boolean-not (Boolean -> Boolean))
(define (boolean-not x)
"The logical negation of `x`. Is `x` false?"
(match x
((True) False)
((False) True)))
(lisp Boolean (x)
(cl:not x)))

(inline)
(declare boolean-or (Boolean -> Boolean -> Boolean))
(define (boolean-or x y)
"Is either `x` or `y` true? Note that this is a *function* which means both `x` and `y` will be evaluated. Use the `or` macro for short-circuiting behavior."
(match x
((True) True)
((False) y)))
(lisp Boolean (x y)
(cl:or x y)))

(inline)
(declare boolean-and (Boolean -> Boolean -> Boolean))
(define (boolean-and x y)
"Are both `x` and `y` true? Note that this is a *function* which means both `x` and `y` will be evaluated. Use the `and` macro for short-circuiting behavior."
(match x
((True) y)
((False) False)))
(lisp Boolean (x y)
(cl:and x y)))

(inline)
(declare boolean-xor (Boolean -> Boolean -> Boolean))
Expand Down

0 comments on commit f801f76

Please sign in to comment.