diff options
author | Eduardo Julian | 2016-12-02 21:39:11 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-12-02 21:39:11 -0400 |
commit | 60d3952d9550cc4d6fd0f5fc8312104b21024799 (patch) | |
tree | 9f73d65b332e87214267055bc71e8e1be593688d /stdlib/source/lux/concurrency/actor.lux | |
parent | 55e411f34d81d8deb0b7d0e25c987dbe16035354 (diff) |
- Changed the names of math op functions to make them more consistent and similar.
Diffstat (limited to 'stdlib/source/lux/concurrency/actor.lux')
-rw-r--r-- | stdlib/source/lux/concurrency/actor.lux | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index 1eb3cee21..b195a8d6c 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -36,9 +36,9 @@ (def: #export (spawn init [proc on-death]) {#;doc "Given a procedure and initial state, launches an actor and returns it."} (All [s m] (-> s (Proc s m) (IO (Actor s m)))) - (io (let [mailbox (stm;var (:! ($ 1) [])) + (io (let [mailbox (stm;var (:! ($ +1) [])) kill-signal (promise;promise Unit) - obituary (promise;promise [(Maybe Text) ($ 0) (List ($ 1))]) + obituary (promise;promise [(Maybe Text) ($ +0) (List ($ +1))]) self {#mailbox mailbox #kill-signal kill-signal #obituary obituary} @@ -109,7 +109,7 @@ {#;doc "Given initial-state and a procedure, launches and actor that will reboot if it dies of errors. However, it can still be killed."} (All [s m] (-> s (Proc s m) (IO (Actor s m)))) - (io (let [ka-actor (: (Actor (Actor ($ 0) ($ 1)) ($ 1)) + (io (let [ka-actor (: (Actor (Actor ($ +0) ($ +1)) ($ +1)) (io;run (spawn (io;run (spawn init proc)) {#step (lambda [*self* message server] (do Monad<Promise> @@ -126,9 +126,9 @@ (wrap (#;Right new-server)))) )))) #end (lambda [_ server] (exec (io;run (poison server)) - (:: Monad<Promise> wrap [])))})))] - (update@ #obituary (: (-> (promise;Promise [(Maybe Text) (Actor ($ 0) ($ 1)) (List ($ 1))]) - (promise;Promise [(Maybe Text) ($ 0) (List ($ 1))])) + (:: Monad<Promise> wrap [])))})))] + (update@ #obituary (: (-> (promise;Promise [(Maybe Text) (Actor ($ +0) ($ +1)) (List ($ +1))]) + (promise;Promise [(Maybe Text) ($ +0) (List ($ +1))])) (lambda [process] (do Monad<Promise> [[_ server unprocessed-messages-0] process @@ -205,7 +205,7 @@ [Int Int] (if (>= 0 to-add) (do Monad<Promise> - [#let [new-state (+ to-add *state*)]] + [#let [new-state (i.+ to-add *state*)]] (wrap (#;Right [new-state [*state* new-state]]))) (do Monad<Promise> [] @@ -223,7 +223,7 @@ methods) protocol-pm (List/map (: (-> Method [AST AST]) (lambda [(^slots [#name #vars #args #return #body])] - (let [arg-names (|> (list;size args) (list;range+ +1) (List/map (|>. Nat/encode [""] ast;symbol))) + (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)) (promise;Promise (Error [(~ g!state-name) (~ return)]))) (lambda (~ (ast;symbol ["" _name])) [(~ g!state) (~@ (List/map (|>. product;left [""] ast;symbol) args))] (do promise;Monad<Promise> @@ -243,7 +243,7 @@ methods) g!proc (` {#step (lambda [(~ g!self) (~ g!message) (~ g!state)] (case (~ g!message) - (~@ (if (=+ +1 (list;size protocol-pm)) + (~@ (if (n.= +1 (list;size protocol-pm)) (List/join (List/map (lambda [[pattern clause]] (list pattern clause)) protocol-pm)) @@ -259,7 +259,7 @@ g!actor-name (ast;symbol ["" _name]) g!methods (List/map (: (-> Method AST) (lambda [(^slots [#name #vars #args #return #body])] - (let [arg-names (|> (list;size args) (list;range+ +1) (List/map (|>. Nat/encode [""] ast;symbol))) + (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) (promise;Promise (~ return))))] |