aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/concurrency
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/control/concurrency')
-rw-r--r--stdlib/source/lux/control/concurrency/actor.lux42
-rw-r--r--stdlib/source/lux/control/concurrency/stm.lux14
2 files changed, 28 insertions, 28 deletions
diff --git a/stdlib/source/lux/control/concurrency/actor.lux b/stdlib/source/lux/control/concurrency/actor.lux
index f4d63c00f..9e17193b2 100644
--- a/stdlib/source/lux/control/concurrency/actor.lux
+++ b/stdlib/source/lux/control/concurrency/actor.lux
@@ -9,7 +9,7 @@
["." exception (#+ exception:)]
["." io (#+ IO io)]
["<>" parser
- ["<c>" code (#+ Parser)]]]
+ ["<.>" code (#+ Parser)]]]
[data
["." product]
[text
@@ -213,8 +213,8 @@
(def: actor_decl^
(Parser [Text (List Text)])
- (<>.either (<c>.form (<>.and <c>.local_identifier (<>.some <c>.local_identifier)))
- (<>.and <c>.local_identifier (\ <>.monad wrap (list)))))
+ (<>.either (<code>.form (<>.and <code>.local_identifier (<>.some <code>.local_identifier)))
+ (<>.and <code>.local_identifier (\ <>.monad wrap (list)))))
(type: On_MailC
[[Text Text Text] Code])
@@ -224,15 +224,15 @@
(def: argument
(Parser Text)
- <c>.local_identifier)
+ <code>.local_identifier)
(def: behavior^
(Parser BehaviorC)
(let [on_mail_args ($_ <>.and ..argument ..argument ..argument)]
($_ <>.and
- (<>.maybe (<c>.form (<>.and (<c>.form (<>.after (<c>.this! (' on_mail)) on_mail_args))
- <c>.any)))
- (<>.some <c>.any))))
+ (<>.maybe (<code>.form (<>.and (<code>.form (<>.after (<code>.this! (' on_mail)) on_mail_args))
+ <code>.any)))
+ (<>.some <code>.any))))
(def: (on_mail g!_ ?on_mail)
(-> Code (Maybe On_MailC) Code)
@@ -295,7 +295,7 @@
(~+ messages))))))))
- (syntax: #export (actor {[state_type init] (<c>.record (<>.and <c>.any <c>.any))}
+ (syntax: #export (actor {[state_type init] (<code>.record (<>.and <code>.any <code>.any))}
{[?on_mail messages] behavior^})
(with_gensyms [g!_]
(wrap (list (` (: ((~! io.IO) (..Actor (~ state_type)))
@@ -315,18 +315,18 @@
(def: signature^
(Parser Signature)
- (<c>.form ($_ <>.and
- (<>.default (list) (<c>.tuple (<>.some <c>.local_identifier)))
- <c>.local_identifier
- (<>.some |input|.parser)
- <c>.local_identifier
- <c>.local_identifier
- <c>.any)))
+ (<code>.form ($_ <>.and
+ (<>.default (list) (<code>.tuple (<>.some <code>.local_identifier)))
+ <code>.local_identifier
+ (<>.some |input|.parser)
+ <code>.local_identifier
+ <code>.local_identifier
+ <code>.any)))
(def: reference^
(Parser [Name (List Text)])
- (<>.either (<c>.form (<>.and <c>.identifier (<>.some <c>.local_identifier)))
- (<>.and <c>.identifier (\ <>.monad wrap (list)))))
+ (<>.either (<code>.form (<>.and <code>.identifier (<>.some <code>.local_identifier)))
+ (<>.and <code>.identifier (\ <>.monad wrap (list)))))
(syntax: #export (message:
{export |export|.parser}
@@ -357,13 +357,13 @@
(..Message (~ (get@ #abstract.abstraction actor_scope))
(~ (get@ #output signature)))))
(function ((~ g!_) (~ g!state) (~ g!self))
- (let [(~ g!state) (:coerce (~ (get@ #abstract.representation actor_scope))
- (~ g!state))]
+ (let [(~ g!state) (:as (~ (get@ #abstract.representation actor_scope))
+ (~ g!state))]
(|> (~ body)
(: ((~! promise.Promise) ((~! try.Try) [(~ (get@ #abstract.representation actor_scope))
(~ (get@ #output signature))])))
- (:coerce ((~! promise.Promise) ((~! try.Try) [(~ (get@ #abstract.abstraction actor_scope))
- (~ (get@ #output signature))]))))))))
+ (:as ((~! promise.Promise) ((~! try.Try) [(~ (get@ #abstract.abstraction actor_scope))
+ (~ (get@ #output signature))]))))))))
))))))
(type: #export Stop
diff --git a/stdlib/source/lux/control/concurrency/stm.lux b/stdlib/source/lux/control/concurrency/stm.lux
index e43ecb98e..d375059a4 100644
--- a/stdlib/source/lux/control/concurrency/stm.lux
+++ b/stdlib/source/lux/control/concurrency/stm.lux
@@ -92,8 +92,8 @@
(All [a] (-> (Var a) Tx (Maybe a)))
(|> tx
(list.find (function (_ [_var _original _current])
- (is? (:coerce (Var Any) var)
- (:coerce (Var Any) _var))))
+ (is? (:as (Var Any) var)
+ (:as (Var Any) _var))))
(\ maybe.monad map (function (_ [_var _original _current])
_current))
(:assume)
@@ -118,11 +118,11 @@
#.Nil
(#.Cons [_var _original _current] tx')
- (if (is? (:coerce (Var Any) var)
- (:coerce (Var Any) _var))
- (#.Cons {#var (:coerce (Var Any) _var)
- #original (:coerce Any _original)
- #current (:coerce Any value)}
+ (if (is? (:as (Var Any) var)
+ (:as (Var Any) _var))
+ (#.Cons {#var (:as (Var Any) _var)
+ #original (:as Any _original)
+ #current (:as Any value)}
tx')
(#.Cons {#var _var
#original _original