Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdearman committed Jan 10, 2024
1 parent 0fa2487 commit aa23612
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/mvp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa23612

Please sign in to comment.