From 023758b4a76da98a658ad5d090047ca1e7cd9a10 Mon Sep 17 00:00:00 2001 From: yoyo Date: Thu, 12 Sep 2024 11:26:04 +0900 Subject: [PATCH] add macro to lib.lisp --- lib/lib.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/lib.lisp b/lib/lib.lisp index 264476f..f9ba664 100644 --- a/lib/lib.lisp +++ b/lib/lib.lisp @@ -20,5 +20,13 @@ (cond (expr) (`(or ,@rest))) expr)) +(macro when (test . rest) + `(if ,test + (progn ,@rest))) + +(macro unless (test . rest) + `(if (not ,test) + (progn ,@rest))) + (defun list (x . y) (cons x y))