diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-10 14:15:45 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-10 14:15:45 +0200 |
commit | 9323c1285a8a9f7ec33e88d26f102d92c7a6e2ec (patch) | |
tree | cfdc7470c4aa088ce77f92f6fff5c3683f92835a /examples | |
parent | 8f0c21094bc69a9adbebc42a4fc4744ed0501428 (diff) | |
download | bdl-9323c1285a8a9f7ec33e88d26f102d92c7a6e2ec.tar.gz bdl-9323c1285a8a9f7ec33e88d26f102d92c7a6e2ec.zip |
Add cond special form
Diffstat (limited to 'examples')
-rw-r--r-- | examples/booleans.bdl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/booleans.bdl b/examples/booleans.bdl index d526f25..24d57a0 100644 --- a/examples/booleans.bdl +++ b/examples/booleans.bdl | |||
@@ -54,3 +54,24 @@ | |||
54 | (print "(if (or (+ 1 2 3) false) (+ 1 2 3) (+ 7 8 9)) -> ") (if (or (+ 1 2 3) false) (+ 1 2 3) (+ 7 8 9)) | 54 | (print "(if (or (+ 1 2 3) false) (+ 1 2 3) (+ 7 8 9)) -> ") (if (or (+ 1 2 3) false) (+ 1 2 3) (+ 7 8 9)) |
55 | (print "(if true 7) -> ") (if true 7) | 55 | (print "(if true 7) -> ") (if true 7) |
56 | (print "(if false 7) -> ") (if false 7) | 56 | (print "(if false 7) -> ") (if false 7) |
57 | |||
58 | ;; Cond. | ||
59 | (print "(cond ((and true true true) 1) ((or true true false) 2) (else 3)) -> ") | ||
60 | (cond ((and true true true) 1) | ||
61 | ((or true true false) 2) | ||
62 | (else 3)) | ||
63 | (print "(cond ((and true true false) 1) ((or true true false) 2) (else 3)) -> ") | ||
64 | (cond ((and true true false) 1) | ||
65 | ((or true true false) 2) | ||
66 | (else 3)) | ||
67 | (print "(cond ((and true true false) 1) ((or false false false) 2) (else 3)) -> ") | ||
68 | (cond ((and true true false) 1) | ||
69 | ((or false false false) 2) | ||
70 | (else 3)) | ||
71 | (print "(cond ((and true true true) 1) ((or true true false) 2)) -> ") | ||
72 | (cond ((and true true false) 1) | ||
73 | ((or false false false) 2)) | ||
74 | (print "(cond ((and true true true) (+ 1 2 3)) ((or true true false) 2) (else 3)) -> ") | ||
75 | (cond ((and true true true) (+ 1 2 3)) | ||
76 | ((or true true false) 2) | ||
77 | (else 3)) | ||