diff options
author | Eduardo Julian | 2017-04-10 22:53:51 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-04-10 22:53:51 -0400 |
commit | 693466dec80764358acea002f0ccfd5f0de17300 (patch) | |
tree | 2caecd6434ffeaa1277af4b6e9e194f27c57a71f /stdlib/source/lux/concurrency/actor.lux | |
parent | 68d28495c9a2014d7b25ff028e955bf8f1ca8dee (diff) |
- Renamed "lambda" to "function".
Diffstat (limited to 'stdlib/source/lux/concurrency/actor.lux')
-rw-r--r-- | stdlib/source/lux/concurrency/actor.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index 56b40f41b..281e42fdd 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -44,7 +44,7 @@ step (step self) |mailbox| (stm;var mailbox-chan) _ (:: Monad<Promise> map - (lambda [_] + (function [_] (io;run (do Monad<IO> [mb (stm;read! |mailbox|)] (frp;close mb)))) @@ -111,7 +111,7 @@ (All [s m] (-> s (Behavior s m) (IO (Actor s m)))) (io (let [ka-actor (: (Actor (Actor ($ +0) ($ +1)) ($ +1)) (io;run (spawn (io;run (spawn init behavior)) - {#step (lambda [*self* message server] + {#step (function [*self* message server] (do Monad<Promise> [was-sent? (send message server)] (if was-sent? @@ -127,11 +127,11 @@ _ (P;future (mapM io;Monad<IO> ((flip stm;write!) mailbox) (#;Cons message unprocessed-messages)))] (wrap (#;Right new-server)))) )))) - #end (lambda [_ server] (exec (io;run (poison server)) + #end (function [_ server] (exec (io;run (poison server)) (:: Monad<Promise> wrap [])))})))] (update@ #obituary (: (-> (P;Promise [(Maybe Text) (Actor ($ +0) ($ +1)) (List ($ +1))]) (P;Promise [(Maybe Text) ($ +0) (List ($ +1))])) - (lambda [process] + (function [process] (do Monad<Promise> [[_ server unprocessed-messages-0] process [cause state unprocessed-messages-1] (get@ #obituary server)] @@ -219,14 +219,14 @@ g!state (ast;symbol ["" "*state*"]) g!cause (ast;symbol ["" "*cause*"]) g!stop-body (default (` (:: P;Monad<Promise> (~' wrap) [])) ?stop) - protocol (List/map (lambda [(^slots [#name #vars #args #return #body])] + protocol (List/map (function [(^slots [#name #vars #args #return #body])] (` ((~ (ast;tag ["" name])) [(~@ (List/map product;right args))] (P;Promise (~ return))))) methods) protocol-pm (List/map (: (-> Method [AST AST]) - (lambda [(^slots [#name #vars #args #return #body])] + (function [(^slots [#name #vars #args #return #body])] (let [arg-names (|> (list;size args) (list;n.range +1) (List/map (|>. Nat/encode [""] ast;symbol))) body-func (` (: (-> (~ g!state-name) (~@ (List/map product;right args)) (P;Promise (Error [(~ g!state-name) (~ return)]))) - (lambda (~ (ast;symbol ["" _name])) [(~ g!state) (~@ (List/map (|>. product;left [""] ast;symbol) args))] + (function (~ (ast;symbol ["" _name])) [(~ g!state) (~@ (List/map (|>. product;left [""] ast;symbol) args))] (do P;Monad<Promise> [] (~ body)))))] @@ -242,24 +242,24 @@ ((~' wrap) (#;Left (~ g!error)))) ))]))) methods) - g!behavior (` {#step (lambda [(~ g!self) (~ g!message) (~ g!state)] + g!behavior (` {#step (function [(~ g!self) (~ g!message) (~ g!state)] (case (~ g!message) (~@ (if (n.= +1 (list;size protocol-pm)) - (List/join (List/map (lambda [[pattern clause]] + (List/join (List/map (function [[pattern clause]] (list pattern clause)) protocol-pm)) - (List/join (List/map (lambda [[method [pattern clause]]] + (List/join (List/map (function [[method [pattern clause]]] (list (` ((~ (ast;tag ["" (get@ #name method)])) (~ pattern))) clause)) (list;zip2 methods protocol-pm))))) )) - #end (lambda [(~ g!cause) (~ g!state)] + #end (function [(~ g!cause) (~ g!state)] (do P;Monad<Promise> [] (~ g!stop-body)))}) g!actor-name (ast;symbol ["" _name]) g!methods (List/map (: (-> Method AST) - (lambda [(^slots [#name #vars #args #return #body])] + (function [(^slots [#name #vars #args #return #body])] (let [arg-names (|> (list;size args) (list;n.range +1) (List/map (|>. Nat/encode [""] ast;symbol))) type (` (-> (~@ (List/map product;right args)) (~ g!actor-name) |