From ad59dab0d1494f8c0372bc65b3849a69032ee5bc Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 24 Oct 2014 08:01:25 -0400 Subject: helpers: Add trampoline procedure. * sly/helpers.scm (trampoline): New procedure. --- sly/helpers.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sly/helpers.scm b/sly/helpers.scm index 9192431..d63d470 100644 --- a/sly/helpers.scm +++ b/sly/helpers.scm @@ -30,7 +30,8 @@ logand? define-guardian memoize - forever)) + forever + trampoline)) (define (any-equal? elem . args) "Return #t if ELEM equals any of the elements in the list ARGS." @@ -69,3 +70,7 @@ same thread that is running the game loop." (define-syntax-rule (forever body ...) (while #t body ...)) + +(define-syntax-rule (trampoline proc) + (lambda args + (apply proc args))) -- cgit v1.2.3