summaryrefslogtreecommitdiff
path: root/sly/actor.scm
diff options
context:
space:
mode:
Diffstat (limited to 'sly/actor.scm')
-rw-r--r--sly/actor.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/sly/actor.scm b/sly/actor.scm
index fd21a64..5b6d7e3 100644
--- a/sly/actor.scm
+++ b/sly/actor.scm
@@ -37,6 +37,7 @@
call-with-actor
action-lift
+ action-effect-lift
idle
both
then
@@ -106,6 +107,18 @@ transformed."
effects
(apply proc object args)))))
+(define (action-effect-lift proc)
+ "Create an action constructor from PROC, a procedure of any number
+of arguments, whose first two arguments are the world being
+transformed and the game object being acted upon. The actions
+returned from this new procedure specify that PROC should be performed
+as an effect on the world, and do not change the actor itself."
+ (lambda args
+ (lambda (world effects object)
+ (values #f
+ (list (lambda (world) (apply proc world object args)))
+ object))))
+
(define (idle world effects object)
"Do nothing. Do not change OBJECT nor add anything to EFFECTS."
(values #f effects object))