diff options
author | Eduardo Julian | 2017-06-21 19:10:24 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-21 19:10:24 -0400 |
commit | d0ec271e90a2be17d2ad5f5e23b0bb3006602bc8 (patch) | |
tree | 7dc817999ab1da7916d663838f574e670c8c1c15 /stdlib/source/lux/concurrency/actor.lux | |
parent | 4a94a3dab463857fb1e881d4ab835ef5351ba9ac (diff) |
- CLI, Syntax and Lexer are now based upon a common Parser type.
Diffstat (limited to 'stdlib/source/lux/concurrency/actor.lux')
-rw-r--r-- | stdlib/source/lux/concurrency/actor.lux | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index 9062feb73..5f75dc912 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -1,6 +1,7 @@ (;module: {#;doc "The actor model of concurrency."} lux - (lux (control monad) + (lux (control monad + ["p" parser]) [io #- run] function (data ["R" result] @@ -150,12 +151,12 @@ (def: method^ (Syntax Method) - (s;form (do s;Monad<Syntax> + (s;form (do p;Monad<Parser> [_ (s;this (' method:)) - vars (s;default (list) (s;tuple (s;some s;local-symbol))) - [name args] (s;form ($_ s;seq + vars (p;default (list) (s;tuple (p;some s;local-symbol))) + [name args] (s;form ($_ p;seq s;local-symbol - (s;many csr;typed-input) + (p;many csr;typed-input) )) return s;any body s;any] @@ -167,15 +168,15 @@ (def: stop^ (Syntax Code) - (s;form (do s;Monad<Syntax> + (s;form (do p;Monad<Parser> [_ (s;this (' stop:))] s;any))) (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 csr;typed-input))) - (s;seq s;local-symbol (:: s;Monad<Syntax> wrap (list)))))) + (p;seq (p;default (list) (s;tuple (p;some s;local-symbol))) + (p;either (s;form (p;seq s;local-symbol (p;many csr;typed-input))) + (p;seq s;local-symbol (:: p;Monad<Parser> wrap (list)))))) (def: (actor-def-decl [_vars _name _args] return-type) (-> [(List Text) Text (List [Text Code])] Code (List Code)) @@ -195,8 +196,8 @@ (syntax: #export (actor: [_ex-lev csr;export] [(^@ decl [_vars _name _args]) actor-decl^] state-type - [methods (s;many method^)] - [?stop (s;opt stop^)]) + [methods (p;many method^)] + [?stop (p;opt stop^)]) {#;doc (doc "Allows defining an actor, with a pice of state and a set of methods that can be called on it." "A method can access the actor's state through the *state* variable." "A method can also access the actor itself through the *self* variable." |