aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-16 19:40:08 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-16 19:40:24 +0200
commita40f14e685e70913e165c63be5b44d79d7b173ab (patch)
tree4a80d075c1f1faf61da537f87e4a9c2dbbca26dc
parentMove `false?` to type module. (diff)
downloadcalp-a40f14e685e70913e165c63be5b44d79d7b173ab.tar.gz
calp-a40f14e685e70913e165c63be5b44d79d7b173ab.tar.xz
Add `not` case to type validators.
-rw-r--r--module/hnh/util/type.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/hnh/util/type.scm b/module/hnh/util/type.scm
index 7e1c5a3d..b9b4f951 100644
--- a/module/hnh/util/type.scm
+++ b/module/hnh/util/type.scm
@@ -23,9 +23,10 @@
;; 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)
+ (syntax-rules (and or not)
((_ variable (and clauses ...)) (and (build-validator-body variable clauses) ...))
((_ variable (or clauses ...)) (or (build-validator-body variable clauses) ...))
+ ((_ variable (not clause)) (not (build-validator-body variable clause)))
((_ variable (proc args ...)) (proc variable args ...))
((_ variable proc) (proc variable))))