summaryrefslogtreecommitdiff
path: root/sly
diff options
context:
space:
mode:
Diffstat (limited to 'sly')
-rw-r--r--sly/actor.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/sly/actor.scm b/sly/actor.scm
index 90803e7..b63a66d 100644
--- a/sly/actor.scm
+++ b/sly/actor.scm
@@ -35,6 +35,7 @@
update-actor
actor-filter-update
call-with-actor
+ apply-effects
action-lift
action-effect-lift
@@ -92,6 +93,14 @@ containing the value returned from PROC."
(let ((new (proc (actor-ref actor))))
(make-actor new (actor-action actor))))
+(define (apply-effects effects world)
+ "Apply each effect procedure in EFFECTS using WORLD as an initial
+value. Each successive effect is applied with the world returned by
+the previous effect."
+ (fold (lambda (effect world) (effect world))
+ world
+ effects))
+
;;;
;;; Actions