summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-10-24 08:01:25 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-10-24 08:01:25 -0400
commitad59dab0d1494f8c0372bc65b3849a69032ee5bc (patch)
tree16ed105306ecb3a38358147b132d2925bf914f7f
parent13b18b33261391ff5f7748336ec0db9e83e03309 (diff)
helpers: Add trampoline procedure.
* sly/helpers.scm (trampoline): New procedure.
-rw-r--r--sly/helpers.scm7
1 files changed, 6 insertions, 1 deletions
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)))