diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-09 23:18:16 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-09 23:20:00 +0200 |
commit | deee127a0e7d1803436033ff40d62f9bdf478c35 (patch) | |
tree | a315364bb5767fbda13776d6454f862871a07bc2 /module/hnh/util | |
parent | Merge typecheck macro into c-parser. (diff) | |
download | calp-deee127a0e7d1803436033ff40d62f9bdf478c35.tar.gz calp-deee127a0e7d1803436033ff40d62f9bdf478c35.tar.xz |
Extend type-clauses with not.
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 800834e5..f35f7839 100644 --- a/module/hnh/util/type.scm +++ b/module/hnh/util/type.scm @@ -22,9 +22,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)))) |