From 12f0605e2522f5221004bb3d7ccc809787ee8dcd Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 8 Nov 2013 19:19:41 -0500 Subject: Fix codefine*. Thank you to shanecelis and mark_weaver. --- 2d/coroutine.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '2d') 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." -- cgit v1.2.3