Added (assert expr) macro
This commit is contained in:
parent
592b62cfe7
commit
d785d40935
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue