aboutsummaryrefslogtreecommitdiff
path: root/lib.macros.lisp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-09 12:35:12 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-11 00:40:19 +0000
commit4977b427d840de3390b802cef297b7c233fe2436 (patch)
tree515a2c8fbebae01db9d4b0910a4a3275db2ea86d /lib.macros.lisp
parente5253472a01fb94233561edf6cadcc86d56767af (diff)
downloadcantedraw-4977b427d840de3390b802cef297b7c233fe2436.tar.gz
cantedraw-4977b427d840de3390b802cef297b7c233fe2436.tar.bz2
cantedraw-4977b427d840de3390b802cef297b7c233fe2436.zip
Implement a `while' macro.
Diffstat (limited to 'lib.macros.lisp')
-rw-r--r--lib.macros.lisp5
1 files changed, 5 insertions, 0 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)))