From: Christopher Allan Webber Date: Tue, 3 May 2016 15:14:11 +0000 (-0500) Subject: actors: Add build-actions and retool make-action-dispatch to use it. X-Git-Tag: v0.2.0~10 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e8a99d0a22f93676617c1d7d0f45cb675ed852ee;p=8sync.git 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. --- 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 ()