aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/concurrency/actor.lux
diff options
context:
space:
mode:
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))
)))