aboutsummaryrefslogtreecommitdiff
path: root/files/test-lambda.l
diff options
context:
space:
mode:
Diffstat (limited to 'files/test-lambda.l')
-rw-r--r--files/test-lambda.l7
1 files changed, 7 insertions, 0 deletions
diff --git a/files/test-lambda.l b/files/test-lambda.l
index 29e1f52..d58169a 100644
--- a/files/test-lambda.l
+++ b/files/test-lambda.l
@@ -77,6 +77,9 @@
(defmacro let* (vars body)
(foldr (lambda (var rest) `(let (,var) ,rest)) body vars))
+(defmacro cond (vars)
+ (foldr (lambda (clause rest) `(if ,(car clause) ,(cdar clause) ,rest)) 1 vars))
+
(let ((a 9)
(b 13))
(+ a b))
@@ -85,3 +88,7 @@
(b (- a 3))
(c (+ a b)))
(- c 3))
+
+(cond (((= 1 2) 3)
+ ((= 1 (+ 1 1)) (+ 6 2))
+ (1 (quote test))))