From 5cf4efa861075f8276f43a2516f5beacaf610b44 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 2 Jul 2021 03:11:36 -0400 Subject: No longer employing the capabilities model on the lux/world/* modules. Capabilities should be opt-in, but using them in the standard library makes them mandatory.--- stdlib/source/program/aedifex/command/auto.lux | 10 ++++---- stdlib/source/program/aedifex/command/build.lux | 29 ++++++++++------------- stdlib/source/program/aedifex/command/clean.lux | 12 ++++------ stdlib/source/program/aedifex/command/install.lux | 4 +--- stdlib/source/program/aedifex/command/pom.lux | 4 +--- stdlib/source/program/aedifex/command/test.lux | 15 +++++------- 6 files changed, 30 insertions(+), 44 deletions(-) (limited to 'stdlib/source/program/aedifex/command') diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index f74d3069a..5f3d95631 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -5,9 +5,7 @@ [control ["." try (#+ Try)] [concurrency - ["." promise (#+ Promise)]] - [security - ["!" capability]]] + ["." promise (#+ Promise)]]] [data [collection ["." list] @@ -29,14 +27,14 @@ (def: (targets fs path) (-> (file.System Promise) Path (Promise (List Path))) (do {! promise.monad} - [?root (!.use (\ fs directory) [path])] + [?root (\ fs directory [path])] (case ?root (#try.Success root) (loop [root root] (do ! [subs (\ ! map (|>> (try.default (list))) - (!.use (\ root directories) []))] - (\ ! map (|>> list.concat (list& (!.use (\ root scope) []))) + (\ root directories []))] + (\ ! map (|>> list.concat (list& (\ root scope))) (monad.map ! recur subs)))) (#try.Failure error) diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 6d61475d0..572ebf0f0 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -7,9 +7,7 @@ ["." exception (#+ exception:)] ["." io (#+ IO)] [concurrency - ["." promise (#+ Promise) ("#\." monad)]] - [security - ["!" capability]]] + ["." promise (#+ Promise) ("#\." monad)]]] [data ["." product] ["." maybe] @@ -140,7 +138,7 @@ (let [[read! write!] (: [(Promise (Try Any)) (promise.Resolver (Try Any))] (promise.promise [])) - _ (|> (!.use (\ process ) []) + _ (|> (\ process []) (promise.await (function (recur ?line) (case ?line (#try.Failure error) @@ -156,7 +154,7 @@ (#try.Success _) (promise.await recur - (!.use (\ process ) [])))) + (\ process [])))) (console.write_line line console))))) io.run)] read!))] @@ -188,19 +186,18 @@ / (\ fs separator) cache_directory (format working_directory / target)] _ (console.write_line ..start console) - process (!.use (\ shell execute) - [environment - working_directory - command - (list.concat (list compiler_params - (list "build") - (..plural "--library" (..libraries fs home resolution)) - (..plural "--source" (set.to_list (get@ #///.sources profile))) - (..singular "--target" cache_directory) - (..singular "--module" program_module)))]) + process (\ shell execute [environment + working_directory + command + (list.concat (list compiler_params + (list "build") + (..plural "--library" (..libraries fs home resolution)) + (..plural "--source" (set.to_list (get@ #///.sources profile))) + (..singular "--target" cache_directory) + (..singular "--module" program_module)))]) _ (..log_output! console process) _ (..log_error! console process) - exit (!.use (\ process await) []) + exit (\ process await []) _ (console.write_line (if (i.= shell.normal exit) ..success ..failure) diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux index b966fe85e..142451113 100644 --- a/stdlib/source/program/aedifex/command/clean.lux +++ b/stdlib/source/program/aedifex/command/clean.lux @@ -5,8 +5,6 @@ [control ["." try (#+ Try)] ["." exception] - [security - ["!" capability]] [concurrency ["." promise (#+ Promise)]]] [data @@ -24,9 +22,9 @@ (-> (Directory Promise) (Promise (Try Any))) (do {! ///action.monad} [nodes (: (Promise (Try (List (File Promise)))) - (!.use (\ root files) [])) + (\ root files [])) _ (monad.map ! (function (_ node) - (!.use (\ node delete) [])) + (\ node delete [])) nodes)] (wrap []))) @@ -39,7 +37,7 @@ (do promise.monad [#let [target (get@ #///.target profile)] root (: (Promise (Try (Directory Promise))) - (!.use (\ fs directory) target))] + (\ fs directory target))] (case root (#try.Success root) (do {! ///action.monad} @@ -47,9 +45,9 @@ (do ! [_ (..clean_files! root) subs (: (Promise (Try (List (Directory Promise)))) - (!.use (\ root directories) [])) + (\ root directories [])) _ (monad.map ! recur subs)] - (!.use (\ root discard) [])))] + (\ root discard [])))] (console.write_line (..success target) console)) (#try.Failure error) diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux index 2e5ce6d89..4b6b96e3e 100644 --- a/stdlib/source/program/aedifex/command/install.lux +++ b/stdlib/source/program/aedifex/command/install.lux @@ -6,9 +6,7 @@ ["." try (#+ Try)] ["." exception] [concurrency - ["." promise (#+ Promise)]] - [security - ["!" capability]]] + ["." promise (#+ Promise)]]] [data [binary (#+ Binary)] [text diff --git a/stdlib/source/program/aedifex/command/pom.lux b/stdlib/source/program/aedifex/command/pom.lux index 16d036718..b8a728904 100644 --- a/stdlib/source/program/aedifex/command/pom.lux +++ b/stdlib/source/program/aedifex/command/pom.lux @@ -4,8 +4,6 @@ [monad (#+ do)]] [control ["." try (#+ Try)] - [security - ["!" capability]] [concurrency ["." promise (#+ Promise) ("#\." monad)]]] [data @@ -37,6 +35,6 @@ outcome (|> pom (\ xml.codec encode) (\ utf8.codec encode) - (!.use (\ file over_write))) + (\ file over_write)) _ (console.write_line ..success console)] (wrap ///pom.file))) diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux index f3ab6c12a..e8b5a2a23 100644 --- a/stdlib/source/program/aedifex/command/test.lux +++ b/stdlib/source/program/aedifex/command/test.lux @@ -4,9 +4,7 @@ [monad (#+ do)]] [control [concurrency - ["." promise (#+ Promise) ("#\." monad)]] - [security - ["!" capability]]] + ["." promise (#+ Promise) ("#\." monad)]]] [data [text ["%" format (#+ format)]]] @@ -44,14 +42,13 @@ #let [[compiler_command compiler_parameters] (case compiler (#//build.JVM artifact) (///runtime.java program) (#//build.JS artifact) (///runtime.node program))] - process (!.use (\ shell execute) - [environment - working_directory - compiler_command - compiler_parameters]) + process (\ shell execute [environment + working_directory + compiler_command + compiler_parameters]) _ (//build.log_output! console process) _ (//build.log_error! console process) - exit (!.use (\ process await) []) + exit (\ process await []) _ (console.write_line (if (i.= shell.normal exit) ..success ..failure) -- cgit v1.2.3