aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control
diff options
context:
space:
mode:
authorEduardo Julian2019-02-17 21:17:58 -0400
committerEduardo Julian2019-02-17 21:17:58 -0400
commit7c4775eda4701b4535261b47a3b4e3da8e5d1da0 (patch)
tree2b4ff191e04ec3396e71000538fb8b95d97075d3 /stdlib/source/lux/control
parent704409a744f6cb921a1f102d2bb6783e9e307538 (diff)
Adapted more tests to the new format.
Diffstat (limited to 'stdlib/source/lux/control')
-rw-r--r--stdlib/source/lux/control/concurrency/actor.lux16
-rw-r--r--stdlib/source/lux/control/region.lux2
-rw-r--r--stdlib/source/lux/control/security/privacy.lux26
3 files changed, 20 insertions, 24 deletions
diff --git a/stdlib/source/lux/control/concurrency/actor.lux b/stdlib/source/lux/control/concurrency/actor.lux
index 6707a6c4d..397a2fdb4 100644
--- a/stdlib/source/lux/control/concurrency/actor.lux
+++ b/stdlib/source/lux/control/concurrency/actor.lux
@@ -1,12 +1,13 @@
(.module: {#.doc "The actor model of concurrency."}
[lux #*
+ ["." function]
[control monad
["p" parser]
["ex" exception (#+ exception:)]]
- ["." io ("#/." monad)]
+ ["." io (#+ IO io) ("#/." monad)]
[data
["." product]
- ["e" error]
+ ["." error]
[text
format]
[collection
@@ -93,14 +94,14 @@
[[head tail] |mailbox|
?state' (handle head state self)]
(case ?state'
- (#e.Failure error)
+ (#error.Failure error)
(do @
[_ (end error state)]
(let [[_ resolve] (get@ #obituary (:representation self))]
(exec (io.run (resolve [error state (#.Cons head (..obituary tail))]))
(wrap []))))
- (#e.Success state')
+ (#error.Success state')
(recur state' tail))))]
self)))
@@ -167,7 +168,7 @@
(def: #export (<resolve> name)
(-> Name (Meta Name))
- (do io.monad
+ (do macro.monad
[[_ annotations _] (macro.find-def name)]
(case (macro.get-tag-ann (name-of <tag>) annotations)
(#.Some actor-name)
@@ -333,7 +334,7 @@
[current-module macro.current-module-name
actor-name (resolve-actor actor-name)
#let [message-name [current-module (get@ #name signature)]
- g!type (code.identifier (product.both id state-name actor-name))
+ g!type (code.identifier (product.both function.identity state-name actor-name))
g!message (code.local-identifier (get@ #name signature))
g!actor-vars (list/map code.local-identifier actor-vars)
actorC (` ((~ (code.identifier actor-name)) (~+ g!actor-vars)))
@@ -386,5 +387,4 @@
((~' wrap) (~ g!task))
((~' wrap) (task.throw ..dead [(~ (code.text (%name actor-name)))
(~ (code.text (%name message-name)))]))))))))
- ))
- )))
+ )))))
diff --git a/stdlib/source/lux/control/region.lux b/stdlib/source/lux/control/region.lux
index ddd86876b..8e12c7675 100644
--- a/stdlib/source/lux/control/region.lux
+++ b/stdlib/source/lux/control/region.lux
@@ -90,7 +90,7 @@
(All [r] (Apply (Region r m)))))
(def: &functor
- (..functor (get@ #monad.functor Monad<m>)))
+ (..functor (get@ #monad.&functor Monad<m>)))
(def: (apply ff fa)
(function (_ [region cleaners])
diff --git a/stdlib/source/lux/control/security/privacy.lux b/stdlib/source/lux/control/security/privacy.lux
index 51d530673..fe6a70233 100644
--- a/stdlib/source/lux/control/security/privacy.lux
+++ b/stdlib/source/lux/control/security/privacy.lux
@@ -7,7 +7,7 @@
[type
abstract]]
[//
- [capability (#+ Capability)]])
+ ["!" capability (#+ capability:)]])
(abstract: #export (Private value label)
{#.doc (doc "A value that is regarded as 'private'."
@@ -21,27 +21,23 @@
## there to prevent confusing private values from different origins.
value
- (type: #export (Can-Conceal label)
+ (capability: #export (Can-Conceal label value)
{#.doc (doc "Represents the capacity to 'privatize' a value.")}
- (All [value]
- (Capability value
- (Private value label))))
+ (can-conceal value (Private value label)))
- (type: #export (Can-Reveal label)
+ (capability: #export (Can-Reveal label value)
{#.doc (doc "Represents the capacity to 'publicize' a value.")}
- (All [value]
- (Capability (Private value label)
- value)))
+ (can-reveal (Private value label) value))
- (signature: #export (Privilege label)
+ (type: #export (Privilege label)
{#.doc (doc "Represents the privilege to both 'privatize' and 'publicize' a value.")}
- [(Can-Conceal label)
- (Can-Reveal label)])
+ {#can-conceal (Can-Conceal label)
+ #can-reveal (Can-Reveal label)})
(def: Privilege<_>
Privilege
- (structure (def: conceal (|>> :abstraction))
- (def: reveal (|>> :representation))))
+ {#can-conceal (..can-conceal (|>> :abstraction))
+ #can-reveal (..can-reveal (|>> :representation))})
(type: #export (Delegation from to)
{#.doc (doc "Represents the act of delegating privatization capacities.")}
@@ -50,7 +46,7 @@
(def: #export (delegation reveal conceal)
{#.doc (doc "Delegating privatization capacities.")}
(All [from to] (-> (Can-Reveal from) (Can-Conceal to) (Delegation from to)))
- (|>> reveal conceal))
+ (|>> (!.use reveal) (!.use conceal)))
(type: #export (Context scope label)
{#.doc (doc "A computational context with an associated privacy privilege.")}