-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmother.lisp
30 lines (20 loc) · 837 Bytes
/
mother.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(defpackage #:mother
(:use #:cl #:alexandria)
(:shadow #:eval))
(in-package #:mother)
(defstruct %ignore)
(defvar *ignore* (make-%ignore))
(defmethod print-object ((object %ignore) stream) (write "#ignore" :stream stream :escape nil))
(defstruct %inert)
(defvar *inert* (make-%inert))
(defmethod print-object ((object %inert) stream) (write "#inert" :stream stream :escape nil))
(defstruct truth)
(defvar *true* (make-truth))
(defmethod print-object ((object truth) stream) (write "#t" :stream stream :escape nil))
(defstruct falsity)
(defvar *false* (make-falsity))
(defmethod print-object ((object falsity) stream) (write "#f" :stream stream :escape nil))
(deftype motherly-boolean () '(or truth falsity))
(declaim (inline kbool))
(defun kbool (b) (if b *true* *false*))
(deftype ptree () '(or null symbol %ignore cons))