diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-16 19:40:08 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-16 19:40:24 +0200 |
commit | a40f14e685e70913e165c63be5b44d79d7b173ab (patch) | |
tree | 4a80d075c1f1faf61da537f87e4a9c2dbbca26dc /module/hnh/util/type.scm | |
parent | Move `false?` to type module. (diff) | |
download | calp-a40f14e685e70913e165c63be5b44d79d7b173ab.tar.gz calp-a40f14e685e70913e165c63be5b44d79d7b173ab.tar.xz |
Add `not` case to type validators.
Diffstat (limited to '')
-rw-r--r-- | module/hnh/util/type.scm | 3 |
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)))) |