From aa23612fa295fc80b51feb1e52a9495deb9f1e99 Mon Sep 17 00:00:00 2001 From: mcdearman Date: Tue, 9 Jan 2024 22:24:13 -0600 Subject: [PATCH] update --- examples/mvp.lisp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/mvp.lisp b/examples/mvp.lisp index 764704f..e37205a 100644 --- a/examples/mvp.lisp +++ b/examples/mvp.lisp @@ -60,6 +60,17 @@ { :a 1 :b 2 } ;; macros +(macro (cond clauses) + (if (empty? clauses) + () + (let (clause (head clauses)) + (if (= (head clause) 'else) + (list 'begin (tail clause)) + (list 'if (head clause) (list 'begin (tail clause)) (cond (tail clauses))))))) + +(macro (when test body) + `(if ,test (begin ,@body) ())) + (macro (while test body) `(let (loop) (if ,test