mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Check the number of args to delay and delay-force
This commit is contained in:
parent
6fabc92b3d
commit
948252517f
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue