-
-
Save callendorph/2d9f93c694f9b0d345ef771d3a868ec6 to your computer and use it in GitHub Desktop.
Assert Check Macro
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
defpackage assert-check : | |
import core | |
import stz/core-macros | |
defsyntax assert : | |
import exp4 from core | |
defrule exp4 = (assert(?check-expr)) : | |
println("Assert Check") | |
println("check-expr = %~" % [check-expr]) | |
val format-string = to-string("ASSERT: %_ = %%~" % [name(unwrap-token(check-expr))]) | |
val form = qquote(println(~ format-string % [~ check-expr])) | |
parse-syntax[core / #exp](form) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment