summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-11-08 19:19:41 -0500
committerDavid Thompson <dthompson2@worcester.edu>2013-11-08 19:19:41 -0500
commit12f0605e2522f5221004bb3d7ccc809787ee8dcd (patch)
tree65dd94abc4c5cfc723b93ae650e9e62d0707a99c
parent98dd19d129e74e146a71fe2caa1c48c1ba232e5c (diff)
Fix codefine*.
Thank you to shanecelis and mark_weaver.
-rw-r--r--2d/coroutine.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/2d/coroutine.scm b/2d/coroutine.scm
index 3e4d256..36071e2 100644
--- a/2d/coroutine.scm
+++ b/2d/coroutine.scm
@@ -61,15 +61,15 @@ coroutine."
(lambda () (name ...)))))
;; emacs: (put 'codefine* 'scheme-indent-function 1)
-(define-syntax-rule (codefine* (name ...) . body)
- "Syntactic sugar for defining a procedure with optional and
-keyword arguments that is run as a coroutine."
- (define* (name ...)
+(define-syntax-rule (codefine* (name . formals) . body)
+ "Syntactic sugar for defining a procedure that is run as a
+coroutine."
+ (define (name . args)
;; Create an inner procedure with the same signature so that a
;; recursive procedure call does not create a new prompt.
- (define* (name ...) . body)
+ (define* (name . formals) . body)
(coroutine
- (lambda () (name ...)))))
+ (lambda () (apply name args)))))
(define (yield callback)
"Yield continuation to a CALLBACK procedure."