Implement a `while' macro.

This commit is contained in:
2025-02-09 12:35:12 +00:00
parent e5253472a0
commit 4977b427d8
2 changed files with 7 additions and 1 deletions

View File

@@ -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)))

View File

@@ -20,7 +20,8 @@
(defpackage lib.macros
(:use :cl)
(:export
:_ :--> :->>))
:_ :--> :->>
:while))
(defpackage main
(:use :cl :lib.macros)