You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
366 B
25 lines
366 B
(def true 1)
|
|
(def false 0)
|
|
|
|
(def ! (lambda (val)
|
|
(cond (val)
|
|
false
|
|
true)))
|
|
|
|
(def ? (lambda (val)
|
|
(cond (val)
|
|
true
|
|
false)))
|
|
|
|
(def or (lambda (a b)
|
|
(? (a b))))
|
|
|
|
(def and (lambda (a b)
|
|
(? (!
|
|
((! a) (! b))))))
|
|
|
|
(def nand (lambda (a b)
|
|
(! (and a b))))
|
|
|
|
(def xor (lambda (a b)
|
|
(and (or a b) (! (and a b))))) |