Skip to content

Instantly share code, notes, and snippets.

@callendorph
Created October 10, 2022 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callendorph/2d9f93c694f9b0d345ef771d3a868ec6 to your computer and use it in GitHub Desktop.
Save callendorph/2d9f93c694f9b0d345ef771d3a868ec6 to your computer and use it in GitHub Desktop.
Assert Check Macro
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