diff options
| author | Mistivia <i@mistivia.com> | 2025-06-21 16:04:00 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-21 16:04:00 +0800 |
| commit | ca22ae606ca674a91e28597a96641c01f7eacb24 (patch) | |
| tree | 01fadb02db0ee2bffe9217373c304dae7c48e19d /src/prelude.lisp | |
| parent | 1b2e36b342be527937ad350690023cb50190f1e0 (diff) | |
add tests
Diffstat (limited to 'src/prelude.lisp')
| -rw-r--r-- | src/prelude.lisp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/prelude.lisp b/src/prelude.lisp index 3e7ab81..7b49977 100644 --- a/src/prelude.lisp +++ b/src/prelude.lisp @@ -9,3 +9,13 @@ `(setq ,i (- ,i 1))) (defun zerop (x) (= x 0)) + +(defmacro when (pred . body) + `(if ,pred + (progn ,@body) + nil)) + +(defmacro unless (pred . body) + `(if ,pred + nil + (progn ,@body))) |
