Allow stateless actors to be given names

This commit is contained in:
Sam Caldwell 2016-07-22 15:11:53 -04:00
parent cecb261c6b
commit 9f8ddc5249
1 changed files with 11 additions and 4 deletions

View File

@ -271,10 +271,17 @@
(transition initial-state-exp initial-action-tree-exp)
#f)))]))
(define-syntax-rule (spawn/stateless behavior-exp initial-action-tree-exp)
(spawn-process (stateless-behavior-wrap behavior-exp)
(void)
initial-action-tree-exp))
(define-syntax spawn/stateless
(syntax-rules ()
[(_ #:name name-exp behavior-exp initial-action-tree-exp)
(spawn-process #:name name-exp
(stateless-behavior-wrap behavior-exp)
(void)
initial-action-tree-exp)]
[(_ behavior-exp initial-action-tree-exp)
(spawn-process (stateless-behavior-wrap behavior-exp)
(void)
initial-action-tree-exp)]))
(define ((stateless-behavior-wrap b) e state)
(match (b e)