diff options
Diffstat (limited to 'module/hnh/util/object.scm')
-rw-r--r-- | module/hnh/util/object.scm | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/module/hnh/util/object.scm b/module/hnh/util/object.scm index 4dbb45a8..4477b462 100644 --- a/module/hnh/util/object.scm +++ b/module/hnh/util/object.scm @@ -1,8 +1,8 @@ (define-module (hnh util object) - :use-module (srfi srfi-1) :use-module (srfi srfi-9 gnu) :use-module (ice-9 curried-definitions) :use-module (hnh util) + :use-module (hnh util type) :export (define-type)) @@ -35,25 +35,6 @@ -;; DSL for specifying type predicates -;; Basically a procedure body, but the variable to test is implicit. -(define-syntax build-validator-body - (syntax-rules (and or list-of) - ((_ variable (and clauses ...)) (and (build-validator-body variable clauses) ...)) - ((_ variable (or clauses ...)) (or (build-validator-body variable clauses) ...)) - ((_ variable (list-of (proc args ...))) - (and (list? variable) - (every (lambda (x) (build-validator-body x (proc args ...))) - variable))) - ((_ variable (list-of proc)) (and (list? variable) - (every proc variable))) - ((_ variable (pair-of a b)) (and (pair? variable) - (build-validator-body (car variable) a) - (build-validator-body (cdr variable) b))) - ((_ variable (proc args ...)) (proc variable args ...)) - ((_ variable proc) (proc variable)))) - - ;; Given (x type: predicate?), expand to a single `unless' form (otherwise #f) (define-syntax (validator stx) (syntax-case stx () |