diff --git a/src/ikarus.boot b/src/ikarus.boot index 65579c5..09f6fc0 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.syntax.ss b/src/ikarus.syntax.ss index b61fb3b..c737ff7 100644 --- a/src/ikarus.syntax.ss +++ b/src/ikarus.syntax.ss @@ -802,6 +802,12 @@ (syntax-match stx () [(_ expr) (bless `(make-promise (lambda () ,expr)))]))) + (define assert-macro + (lambda (stx) + (syntax-match stx () + [(_ expr) + (bless `(unless ,expr + (error 'assert "~s failed" ',expr)))]))) (define identifier-syntax-macro (lambda (stx) (syntax-match stx () @@ -1704,6 +1710,7 @@ [(identifier-syntax) identifier-syntax-macro] [(time) time-macro] [(delay) delay-macro] + [(assert) assert-macro] [(... => _ else unquote unquote-splicing unsyntax unsyntax-splicing) incorrect-usage-macro] diff --git a/src/makefile.ss b/src/makefile.ss index f0afecb..59ed446 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -113,6 +113,7 @@ [or (macro . or)] [time (macro . time)] [delay (macro . delay)] + [assert (macro . assert)] [... (macro . ...)] [=> (macro . =>)] [else (macro . else)] @@ -249,6 +250,7 @@ [or i r ne] [time i] [delay i ne] + [assert i r] [... i r ne] [=> i r ne] [else i r ne] diff --git a/src/todo-r6rs.ss b/src/todo-r6rs.ss index bf3ae37..d83ddc5 100755 --- a/src/todo-r6rs.ss +++ b/src/todo-r6rs.ss @@ -84,7 +84,7 @@ [append C ba se] [apply C ba se] [asin S ba se] - [assert S ba] + [assert C ba] [assertion-violation S ba] [atan S ba se] [boolean=? C ba]