Last active
December 12, 2023 06:31
-
-
Save trepca/f5aa4c1ec32486e6a6a979d3a352e8ac to your computer and use it in GitHub Desktop.
Chialisp assert macro for debugging by @prozacchiwawa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(mod (N) | |
(include *standard-cl-23*) | |
(defun assert_ (items) | |
(if (r items) | |
(qq (if (unquote (f items)) (unquote (assert_ (r items))) (x (unquote (c 1 (f items)))))) | |
(f items) | |
) | |
) | |
(defmac assert items (assert_ items)) | |
(assert (> 50 N) (> N 20) (logand N 1) N) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It will show you exactly which condition in assert fails, super useful.