From c5b61d2f46ac19bf511197f3a537c4be0f47df33 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 27 Aug 2021 20:59:34 -0400 Subject: Updates to the Ruby compiler. --- .../library/lux/control/security/capability.lux | 37 +++++++++++----------- .../source/library/lux/control/security/policy.lux | 12 +++---- 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'stdlib/source/library/lux/control/security') diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index ec84db916..e6d2617c9 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -30,13 +30,13 @@ (-> input output) (def: capability - (All [brand input output] + (All (_ brand input output) (-> (-> input output) (Capability brand input output))) (|>> :abstraction)) (def: .public (use capability input) - (All [brand input output] + (All (_ brand input output) (-> (Capability brand input output) input output)) @@ -48,24 +48,25 @@ |declaration|.parser (<>.maybe |annotations|.parser) (.form ($_ <>.and .local_identifier .any .any))))]) - (do {! meta.monad} - [this_module meta.current_module_name - .let [[name vars] declaration] - g!brand (\ ! each (|>> %.code code.text) - (macro.identifier (format (%.name [this_module name])))) - .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]] - (in (list (` (type: (~ export_policy) - (~ (|declaration|.format declaration)) - (~ capability))) - (` (def: (~ (code.local_identifier forger)) - (All [(~+ (list\each code.local_identifier vars))] - (-> (-> (~ input) (~ output)) - (~ capability))) - (~! ..capability))) - )))) + (macro.with_identifiers [g!_] + (do {! meta.monad} + [this_module meta.current_module_name + .let [[name vars] declaration] + g!brand (\ ! each (|>> %.code code.text) + (macro.identifier (format (%.name [this_module name])))) + .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]] + (in (list (` (type: (~ export_policy) + (~ (|declaration|.format declaration)) + (~ capability))) + (` (def: (~ (code.local_identifier forger)) + (All ((~ g!_) (~+ (list\each code.local_identifier vars))) + (-> (-> (~ input) (~ output)) + (~ capability))) + (~! ..capability))) + ))))) (def: .public (async capability) - (All [brand input output] + (All (_ brand input output) (-> (Capability brand input (IO output)) (Capability brand input (Async output)))) (..capability (|>> ((:representation capability)) async.future))) diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index 1087cf751..c9e840698 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -25,12 +25,12 @@ #can_downgrade (Can_Downgrade brand label)})) (type: .public (Delegation brand from to) - (All [value] + (All (_ value) (-> (Policy brand value from) (Policy brand value to)))) (def: .public (delegation downgrade upgrade) - (All [brand from to] + (All (_ brand from to) (-> (Can_Downgrade brand from) (Can_Upgrade brand to) (Delegation brand from to))) (|>> downgrade upgrade)) @@ -45,16 +45,16 @@ #can_downgrade (|>> :representation)}) (def: .public (with_policy context) - (All [brand scope] - (Ex [label] + (All (_ brand scope) + (Ex (_ label) (-> (Context brand scope label) (scope label)))) (context ..privilege)) (def: (of_policy constructor) (-> Type Type) - (type (All [brand label] - (constructor (All [value] (Policy brand value label)))))) + (type (All (_ brand label) + (constructor (All (_ value) (Policy brand value label)))))) (implementation: .public functor (:~ (..of_policy Functor)) -- cgit v1.2.3