From e8a99d0a22f93676617c1d7d0f45cb675ed852ee Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 3 May 2016 10:14:11 -0500 Subject: [PATCH] actors: Add build-actions and retool make-action-dispatch to use it. * 8sync/systems/actors.scm (build-actions): New macro. (make-action-dispatch): Retool to use build-actions. --- 8sync/systems/actors.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/8sync/systems/actors.scm b/8sync/systems/actors.scm index 270b25f..c33240f 100644 --- a/8sync/systems/actors.scm +++ b/8sync/systems/actors.scm @@ -369,6 +369,9 @@ Which is like doing manually: ((_ (action-name handler)) (cons (quote action-name) handler)))) +(define-syntax-rule (build-actions action-item ...) + (list (%expand-action-item action-item) ...)) + (define-syntax make-action-dispatch (syntax-rules () "Expand a list of action names and actions into an alist @@ -390,8 +393,7 @@ more compact following syntax: ((party actor message) (display \"Life of the party!\")))" ((make-action-dispatch action-item ...) - (simple-dispatcher - (list (%expand-action-item action-item) ...))))) + (simple-dispatcher (build-actions action-item ...))))) (define-syntax-rule (define-simple-actor class actions ...) (define-class class () -- 2.31.1