You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#lang racket/base
|
|
|
|
(require racket/match
|
|
|
|
"constants.rkt"
|
|
|
|
"struct.rkt")
|
|
|
|
(provide (all-defined-out))
|
|
|
|
|
|
|
|
(define-syntax-rule (define-guarded-parameters [ID PRED STARTING-VALUE] ...)
|
|
|
|
(begin
|
|
|
|
(define ID
|
|
|
|
(make-parameter STARTING-VALUE
|
|
|
|
(λ (val)
|
|
|
|
(unless (PRED val)
|
|
|
|
(raise-argument-error 'ID (format "~a" (object-name PRED)) val))
|
|
|
|
val))) ...))
|
|
|
|
|
|
|
|
(define-guarded-parameters
|
|
|
|
[current-attrs (λ (xs) (and (list? xs) (andmap attr-key? xs))) all-attrs]
|
|
|
|
[current-show-timing? boolean? #false]
|
|
|
|
[current-strict-attrs? boolean? #false]
|
|
|
|
[current-use-preconditions? boolean? #true]
|
|
|
|
[current-use-postconditions? boolean? #true])
|