projects
/
8sync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
actors: Add build-actions and retool make-action-dispatch to use it.
[8sync.git]
/
8sync
/
systems
/
actors.scm
diff --git
a/8sync/systems/actors.scm
b/8sync/systems/actors.scm
index 270b25f452909e5a000780bd7de5e968d47d63d2..c33240f309cc181dcf030b905a43b989e4cec186 100644
(file)
--- 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))))
((_ (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
(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 ...)
((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 (<actor>)
(define-syntax-rule (define-simple-actor class actions ...)
(define-class class (<actor>)