diff options
-rw-r--r-- | lib.macros.lisp | 5 | ||||
-rw-r--r-- | packages.lisp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib.macros.lisp b/lib.macros.lisp index bf0bdcc..f96636d 100644 --- a/lib.macros.lisp +++ b/lib.macros.lisp @@ -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))) diff --git a/packages.lisp b/packages.lisp index dafbc95..8e66c78 100644 --- a/packages.lisp +++ b/packages.lisp @@ -20,7 +20,8 @@ (defpackage lib.macros (:use :cl) (:export - :_ :--> :->>)) + :_ :--> :->> + :while)) (defpackage main (:use :cl :lib.macros) |