From a40f14e685e70913e165c63be5b44d79d7b173ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 16 Oct 2023 19:40:08 +0200 Subject: Add `not` case to type validators. --- module/hnh/util/type.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)))) -- cgit v1.2.3