From f638923c6f7842bc2319bb03555726869098a1c5 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 29 Nov 2016 10:19:52 +1300 Subject: [PATCH] `current-action-transformer` --- racket/syndicate/actor.rkt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/racket/syndicate/actor.rkt b/racket/syndicate/actor.rkt index 15085f9..18e0d04 100644 --- a/racket/syndicate/actor.rkt +++ b/racket/syndicate/actor.rkt @@ -59,6 +59,7 @@ ;; + current-action-transformer schedule-action! schedule-actions! actor-action @@ -250,6 +251,9 @@ ;; Parameterof Boolean (define in-script? (make-parameter #f)) +;; Parameterof (Action -> Action) +(define current-action-transformer (make-parameter values)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Syntax; main entry points @@ -930,7 +934,8 @@ (when (patch-non-empty? ac) (current-pending-patch (compose-patch ac (current-pending-patch)))) (begin (flush-pending-patch!) - (current-pending-actions (list (current-pending-actions) ac))))) + (current-pending-actions (list (current-pending-actions) + ((current-action-transformer) ac)))))) (define (schedule-actions! . acs) (for [(ac (core:clean-actions acs))] (schedule-action! ac))) @@ -939,7 +944,8 @@ (define p (current-pending-patch)) (when (patch-non-empty? p) (current-pending-patch patch-empty) - (current-pending-actions (list (current-pending-actions) p)))) + (current-pending-actions (list (current-pending-actions) + ((current-action-transformer) p))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Endpoint Creation