From: Taylor R Campbell Date: Sat, 24 Mar 2012 22:01:56 +0000 (+0000) Subject: Add ASSERT macro. X-Git-Tag: release-9.2.0~256^2~1 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b14d7a55ac99347a4b52cef8012496cdf0a8229d;p=mit-scheme.git Add ASSERT macro. --- diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index 4888170f1..76efa17e2 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -600,4 +600,10 @@ USA. ((BEGIN0 form0 form1+ ...) (LET ((RESULT form0)) form1+ ... - RESULT)))) \ No newline at end of file + RESULT)))) + +(define-syntax :assert + (syntax-rules () + ((ASSERT condition) + (IF (NOT condition) + (ERROR "Assertion failed:" 'condition))))) \ No newline at end of file diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 67dd38317..15198d565 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4766,6 +4766,7 @@ USA. (access :access) (and :and) (and-let* :and-let*) + (assert :assert) (begin0 :begin0) (case :case) (cond :cond)