diff options
author | Eduardo Julian | 2021-09-03 21:51:30 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-03 21:51:30 -0400 |
commit | 891b1cfc82322f8017f0a4f6b707d6fe52024545 (patch) | |
tree | 957429c0a2ad850b3570492deabe054fb2ace63e /stdlib/source/library/lux/control/concurrency/actor.lux | |
parent | e76add6e6f904677f5c09bb2a66dce283f1b848a (diff) |
Unified tuple and record syntax.
Diffstat (limited to 'stdlib/source/library/lux/control/concurrency/actor.lux')
-rw-r--r-- | stdlib/source/library/lux/control/concurrency/actor.lux | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 6d47288df..7353bad84 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -66,9 +66,9 @@ {} (Record - {#obituary [(Async <Obituary>) + [#obituary [(Async <Obituary>) (Resolver <Obituary>)] - #mailbox (Atom <Mailbox>)}) + #mailbox (Atom <Mailbox>)]) (type: .public (Mail s) <Mail>) @@ -78,8 +78,8 @@ (type: .public (Behavior o s) (Record - {#on_init (-> o s) - #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))})) + [#on_init (-> o s) + #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))])) (def: .public (spawn! behavior init) (All (_ o s) (-> (Behavior o s) o (IO (Actor s)))) @@ -89,8 +89,8 @@ behavior (Actor s) - (:abstraction {#obituary (async.async []) - #mailbox (atom (async.async []))})) + (:abstraction [#obituary (async.async []) + #mailbox (atom (async.async []))])) process (loop [state (on_init init) [|mailbox| _] (io.run! (atom.read! (value@ #mailbox (:representation self))))] (do {! async.monad} @@ -204,8 +204,8 @@ (def: .public default (All (_ s) (Behavior s s)) - {#on_init function.identity - #on_mail ..default_on_mail}) + [#on_init function.identity + #on_mail ..default_on_mail]) (def: .public (poison! actor) (All (_ s) (-> (Actor s) (IO (Try Any)))) @@ -274,8 +274,8 @@ (def: (~ export_policy) (~ g!actor) (All ((~ g!_) (~+ g!vars)) (..Behavior (~ state_type) ((~ g!type) (~+ g!vars)))) - {#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) + [#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) + #..on_mail (~ (..on_mail g!_ ?on_mail))]) (~+ messages)))))))) @@ -284,18 +284,18 @@ (with_identifiers [g!_] (in (list (` (: ((~! io.IO) (..Actor (~ state_type))) (..spawn! (: (..Behavior (~ state_type) (~ state_type)) - {#..on_init (|>>) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) + [#..on_init (|>>) + #..on_mail (~ (..on_mail g!_ ?on_mail))]) (: (~ state_type) (~ init))))))))) (type: Signature (Record - {#vars (List Text) + [#vars (List Text) #name Text #inputs (List |input|.Input) #state Text - #self Text})) + #self Text])) (def: signature^ (Parser Signature) |