diff options
author | Eduardo Julian | 2021-07-27 03:51:10 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-27 03:51:10 -0400 |
commit | 061fd8a209bbcaffc2bfb850ac6046752a567d50 (patch) | |
tree | 8cd83ad7d0bc06ded7976eb5420467e485733ae8 /stdlib/source/library/lux/world/shell.lux | |
parent | e64b6d0114c26a455e19a416b5f02a4d19dd711f (diff) |
Re-named wrap => in && unwrap => out.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/world/shell.lux | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux index b186f27a8..c9f524a69 100644 --- a/stdlib/source/library/lux/world/shell.lux +++ b/stdlib/source/library/lux/world/shell.lux @@ -89,7 +89,7 @@ (async.future (do (try.with io.monad) [process (\ shell execute input)] - (wrap (..async_process process))))))) + (in (..async_process process))))))) ## https://en.wikipedia.org/wiki/Code_injection#Shell_injection (interface: (Policy ?) @@ -238,31 +238,31 @@ jvm_error (|> jvm_error java/io/InputStreamReader::new java/io/BufferedReader::new)]] - (wrap (: (Process IO) - (`` (implementation - (~~ (template [<name> <stream>] - [(def: (<name> _) - (do ! - [output (java/io/BufferedReader::readLine <stream>)] - (case output - (#.Some output) - (wrap output) - - #.None - (\ io.monad wrap (exception.throw ..no_more_output [])))))] - - [read jvm_input] - [error jvm_error] - )) - (def: (write message) - (java/io/OutputStream::write (\ utf8.codec encode message) jvm_output)) - (~~ (template [<name> <method>] - [(def: (<name> _) - (<method> process))] - - [destroy java/lang/Process::destroy] - [await java/lang/Process::waitFor] - )))))))) + (in (: (Process IO) + (`` (implementation + (~~ (template [<name> <stream>] + [(def: (<name> _) + (do ! + [output (java/io/BufferedReader::readLine <stream>)] + (case output + (#.Some output) + (in output) + + #.None + (\ io.monad in (exception.except ..no_more_output [])))))] + + [read jvm_input] + [error jvm_error] + )) + (def: (write message) + (java/io/OutputStream::write (\ utf8.codec encode message) jvm_output)) + (~~ (template [<name> <method>] + [(def: (<name> _) + (<method> process))] + + [destroy java/lang/Process::destroy] + [await java/lang/Process::waitFor] + )))))))) (import: java/io/File ["#::." @@ -298,7 +298,7 @@ _ (|> builder java/lang/ProcessBuilder::environment (\ try.functor map (..jvm::load_environment environment)) - (\ io.monad wrap)) + (\ io.monad in)) process (java/lang/ProcessBuilder::start builder)] (..default_process process)))) )] @@ -329,10 +329,10 @@ (#try.Success [|state| output]) (do ! [_ (atom.write |state| state)] - (wrap (#try.Success output))) + (in (#try.Success output))) (#try.Failure error) - (wrap (#try.Failure error)))))] + (in (#try.Failure error)))))] [read on_read] [error on_error] @@ -345,10 +345,10 @@ (#try.Success |state|) (do ! [_ (atom.write |state| state)] - (wrap (#try.Success []))) + (in (#try.Success []))) (#try.Failure error) - (wrap (#try.Failure error))))) + (in (#try.Failure error))))) (def: (destroy _) (do {! io.monad} [|state| (atom.read state)] @@ -356,10 +356,10 @@ (#try.Success |state|) (do ! [_ (atom.write |state| state)] - (wrap (#try.Success []))) + (in (#try.Success []))) (#try.Failure error) - (wrap (#try.Failure error))))))) + (in (#try.Failure error))))))) (implementation: #export (mock mock init) (All [s] |