Coverage report: /home/runner/work/geb/geb/src/geb/bool.lisp
Kind | Covered | All | % |
expression | 0 | 103 | 0.0 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
3
;; I need a defadt macro, all this is all derivable, trivial so even?
5
;; Also I want a variable to control so Ι can expand these names
6
;; only, as Ι pretty print.
8
(def false-obj (alias false (so1)))
9
(def true-obj (alias true (so1)))
11
(def true (alias true (->right false-obj true-obj)))
12
(def false (alias false (->left false-obj true-obj)))
14
(def bool (alias bool (coprod false-obj true-obj)))
16
;; TODO make my own custom def macro so they are with the defn!
18
(setf (documentation 'bool 'pax:symbol-macro)
19
"The Boolean Type, composed of a coproduct of two unit objects
25
(setf (documentation 'true 'pax:symbol-macro)
26
"The true value of a boolean type. In this case we've defined true as
29
(setf (documentation 'false 'pax:symbol-macro)
30
"The false value of a boolean type. In this case we've defined true as
33
(defun so-uncurry (x y f)
36
;; we are seeing a trend in definitions!
37
;; this gives us a peek at what to make macros over
42
(setf (documentation 'not 'pax:symbol-macro)
43
"Turns a TRUE into a FALSE and vice versa")
45
;; this is curried and,
47
(pair (const false bool)
53
(mcase (comp (->left bool bool)
54
(bool-from false-obj))
55
(comp (->right bool bool)
56
(bool-from true-obj)))))
59
(mcase (const false bool) bool))
62
(comp and-on-sum iso1 (distribute bool false-obj true-obj)))
65
(comp (mcase (const false (prod bool false-obj))
66
(<-left bool true-obj))
67
(distribute bool false-obj true-obj)))