(module parameters mzscheme
(require (file "constants.ss"))
(provide (all-defined-except real-state false->nil))
(define (false->nil x)
(if (eq? x #f)
nil
x))
(define set-irrelevant-formals-ok
(make-parameter nil
(lambda (x) (let ([value (false->nil x)]) value))))
(define set-guard-checking
(make-parameter
t
(lambda (x)
(let ([value (false->nil x)])
value))))
(define-for-syntax state-ok? (make-parameter #f))
(define-syntax (set-state-ok stx)
(syntax-case stx (nil)
[(_ nil) (begin (state-ok? #f) #'nil)]
[(_ e) (begin (state-ok? #t) #'t)]))
(define-syntax (real-state stx)
(syntax-case stx ()
[(_ st) (if (state-ok?)
(syntax 'STATE)
(raise-syntax-error 'state "State is not enabled; use (set-state-ok t) to enable it" #'st))]))
(define-syntax state
(syntax-id-rules ()
[state (real-state state)]))
(define set-ignore-ok
(make-parameter nil
(lambda (x) (let ([value (false->nil x)]) value))))
(define set-compile-fns
(make-parameter
nil
(lambda (x)
(let ([value (false->nil x)])
value))))
(define-syntax (set-well-founded-relation stx)
(syntax-case stx ()
[(_ relation) (syntax/loc stx (begin))]))
)