-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcombining.tem
10 lines (10 loc) · 1.35 KB
/
combining.tem
1
2
3
4
5
6
7
8
9
10
(page "Boolean operations"
(newtable "Booleans"
(import "docs/boolean0.html")
(def predicate no "expr" "Complement: returns true if <code>expr</code> is false, and false if <code>expr</code> is true." (tests (no 1) (no nil)))
(mac and "[arg ...]" "The and boolean operator tests if all the arguments are true. It evaluates its arguments in turn until a false argument is found.
If all arguments are true, the last argument is returned. If all arguments are false, nil is returned. The and operator performs 'short-circuit' evaluation, and doesn't evaluate arguments that follow a false one." (tests (and 1 t 0 "x") (and nil t) (and nil (/ 1 0))))
(mac or "[arg ...]" "The or boolean operator tests if any of the arguments are true. It evaluates its arguments in turn until a true argument is found. If any argument is true, the first true argument is returned. If all arguments are false, nil is returned. The or operator performs 'short-circuit' evaluation, and doesn't evaluate arguments that follow a true one." (tests (or nil 42 '() (/ 1 0)) (or nil '()) ))
(mac nor "[arg ...]" "The nor boolean operator tests if all of the arguments are false. It returns t if all arguments are false, and nil if any arguments are true. It performs 'short-circuit' evaluation, and doesn't evaluate arguments that follow a true one." (tests (nor nil nil) (nor nil 1 (/ 1 0))))
)
)