aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/concurrency/actor.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-06-19 20:03:02 -0400
committerEduardo Julian2017-06-19 20:03:02 -0400
commit6979cbb0e4d04a65c041381237aa034b4b708550 (patch)
tree116a817df5febd62ce2246718b8948253c91b4e6 /stdlib/source/lux/concurrency/actor.lux
parent88b22b2dbfc6eabeb933aca85d06991efa6253be (diff)
- Split "lux/macro/syntax/common" into 2 other sub-modules ("reader" and "writer").
Diffstat (limited to 'stdlib/source/lux/concurrency/actor.lux')
-rw-r--r--stdlib/source/lux/concurrency/actor.lux20
1 files changed, 11 insertions, 9 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index e9a6b5d37..9062feb73 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -11,7 +11,9 @@
[macro #+ with-gensyms]
(macro [code]
["s" syntax #+ syntax: Syntax]
- (syntax [common]))
+ (syntax ["cs" common]
+ (common ["csr" reader]
+ ["csw" writer])))
[type])
(.. ["P" promise #+ Monad<Promise>]
[stm #+ Monad<STM>]
@@ -153,7 +155,7 @@
vars (s;default (list) (s;tuple (s;some s;local-symbol)))
[name args] (s;form ($_ s;seq
s;local-symbol
- (s;many common;typed-input)
+ (s;many csr;typed-input)
))
return s;any
body s;any]
@@ -172,7 +174,7 @@
(def: actor-decl^
(Syntax [(List Text) Text (List [Text Code])])
(s;seq (s;default (list) (s;tuple (s;some s;local-symbol)))
- (s;either (s;form (s;seq s;local-symbol (s;many common;typed-input)))
+ (s;either (s;form (s;seq s;local-symbol (s;many csr;typed-input)))
(s;seq s;local-symbol (:: s;Monad<Syntax> wrap (list))))))
(def: (actor-def-decl [_vars _name _args] return-type)
@@ -190,7 +192,7 @@
(list decl
type)))
-(syntax: #export (actor: [_ex-lev common;export]
+(syntax: #export (actor: [_ex-lev csr;export]
[(^@ decl [_vars _name _args]) actor-decl^]
state-type
[methods (s;many method^)]
@@ -264,16 +266,16 @@
type (` (-> (~@ (List/map product;right args))
(~ g!actor-name)
(P;Promise (~ return))))]
- (` (def: (~@ (common;gen-export _ex-lev)) ((~ (code;symbol ["" name])) (~@ arg-names) (~ g!self))
+ (` (def: (~@ (csw;export _ex-lev)) ((~ (code;symbol ["" name])) (~@ arg-names) (~ g!self))
(~ type)
(let [(~ g!output) (P;promise (~ return))]
(exec (send ((~ (code;tag ["" name])) [[(~@ arg-names)] (~ g!output)]) (~ g!self))
(~ g!output))))))))
methods)]
- (wrap (list& (` (type: (~@ (common;gen-export _ex-lev)) (~ g!state-name) (~ state-type)))
- (` (type: (~@ (common;gen-export _ex-lev)) (~ g!protocol-name) (~@ protocol)))
- (` (type: (~@ (common;gen-export _ex-lev)) (~ g!actor-name) (Actor (~ g!state-name) (~ g!protocol-name))))
- (` (def: (~@ (common;gen-export _ex-lev)) (~@ (actor-def-decl decl (` (Behavior (~ g!state-name) (~ g!protocol-name)))))
+ (wrap (list& (` (type: (~@ (csw;export _ex-lev)) (~ g!state-name) (~ state-type)))
+ (` (type: (~@ (csw;export _ex-lev)) (~ g!protocol-name) (~@ protocol)))
+ (` (type: (~@ (csw;export _ex-lev)) (~ g!actor-name) (Actor (~ g!state-name) (~ g!protocol-name))))
+ (` (def: (~@ (csw;export _ex-lev)) (~@ (actor-def-decl decl (` (Behavior (~ g!state-name) (~ g!protocol-name)))))
(~ g!behavior)))
g!methods))
)))