Implement a `while' macro.
This commit is contained in:
@@ -61,3 +61,8 @@ Like the `|>' operator in Ocaml."
|
||||
:for canon-func = (if (symbolp func) (list func) func)
|
||||
:do (setq acc (append canon-func (list acc)))
|
||||
:finally (return acc))))
|
||||
|
||||
(defmacro while (condition &body body)
|
||||
`(loop :while ,condition
|
||||
:do
|
||||
(progn ,@body)))
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
(defpackage lib.macros
|
||||
(:use :cl)
|
||||
(:export
|
||||
:_ :--> :->>))
|
||||
:_ :--> :->>
|
||||
:while))
|
||||
|
||||
(defpackage main
|
||||
(:use :cl :lib.macros)
|
||||
|
||||
Reference in New Issue
Block a user