From 948252517f56927838eca0c8a2b6e4af1647d14c Mon Sep 17 00:00:00 2001 From: Kris Katterjohn Date: Wed, 8 Jul 2020 19:15:06 -0400 Subject: [PATCH] Check the number of args to delay and delay-force --- lib/init-7.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/init-7.scm b/lib/init-7.scm index 5d802fe1..5d8c299e 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -360,11 +360,15 @@ (define-syntax delay-force (er-macro-transformer (lambda (expr rename compare) + (if (null? (cdr expr)) (error "not enough args" expr)) + (if (not (null? (cddr expr))) (error "too many args" expr)) `(,(rename 'promise) #f (,(rename 'lambda) () ,(cadr expr)))))) (define-syntax delay (er-macro-transformer (lambda (expr rename compare) + (if (null? (cdr expr)) (error "not enough args" expr)) + (if (not (null? (cddr expr))) (error "too many args" expr)) `(,(rename 'delay-force) (,(rename 'promise) #t ,(cadr expr)))))) (define-syntax define-auxiliary-syntax