mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Translate assume to a noop when assumptions are disabled
This commit is contained in:
parent
043e4c2214
commit
251464eade
1 changed files with 19 additions and 26 deletions
|
@ -1,9 +1,10 @@
|
|||
|
||||
(define-library (srfi 145)
|
||||
(export assume)
|
||||
(import (scheme base))
|
||||
(cond-expand
|
||||
(elide-assumptions
|
||||
((or elide-assumptions
|
||||
(and (not assumptions)
|
||||
(not debug)))
|
||||
(begin
|
||||
(define-syntax assume
|
||||
(syntax-rules ()
|
||||
|
@ -17,14 +18,6 @@
|
|||
(syntax-rules ()
|
||||
((assume expression objs ...)
|
||||
(or expression
|
||||
(fatal-error "invalid assumption" 'expression objs ...)))
|
||||
(error "invalid assumption" 'expression objs ...)))
|
||||
((assume)
|
||||
(syntax-error "assume requires an expression")))))))
|
||||
(cond-expand
|
||||
(debug
|
||||
(begin
|
||||
(define fatal-error error)))
|
||||
(else
|
||||
(begin
|
||||
(define (fatal-error message . objs)
|
||||
(car 0))))))
|
||||
(syntax-error "assume requires an expression"))))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue