diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/world/file.lux | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 9db2c4547..3b768f0a1 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -25,9 +25,9 @@ ["[0]" list (.use "[1]#[0]" functor)] ["[0]" dictionary (.only Dictionary)]]] ["[0]" ffi (.only) - (.~~ (.for "JavaScript" (.~~ (.these ["[0]" node_js])) - "{old}" (.~~ (.these ["node_js" //control/thread])) - (.~~ (.these))))] + (.,, (.for "JavaScript" (.,, (.these ["[0]" node_js])) + "{old}" (.,, (.these ["node_js" //control/thread])) + (.,, (.these))))] [macro ["[0]" template]] [math @@ -46,7 +46,7 @@ (is Text separator) - (~~ (with_template [<name> <output>] + (,, (with_template [<name> <output>] [(is (-> Path (! <output>)) <name>)] @@ -54,7 +54,7 @@ [directory? Bit] )) - (~~ (with_template [<name> <output>] + (,, (with_template [<name> <output>] [(is (-> Path (! (Try <output>))) <name>)] @@ -69,7 +69,7 @@ [delete Any] )) - (~~ (with_template [<name> <input>] + (,, (with_template [<name> <input>] [(is (-> Path <input> (! (Try Any))) <name>)] @@ -112,7 +112,7 @@ (def separator (at fs separator)) - (~~ (with_template [<name>] + (,, (with_template [<name>] [(def <name> (|>> (at fs <name>) async.future))] @@ -130,7 +130,7 @@ [read] [delete])) - (~~ (with_template [<name>] + (,, (with_template [<name>] [(def (<name> path input) (async.future (at fs <name> path input)))] @@ -163,7 +163,7 @@ (`` (ffi.import java/io/File "[1]::[0]" (new [java/lang/String]) - (~~ (with_template [<name>] + (,, (with_template [<name>] [(<name> [] "io" "try" boolean)] [createNewFile] [mkdir] @@ -206,7 +206,7 @@ (def separator (ffi.of_string (java/io/File::separator))) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def <name> (|>> ffi.as_string java/io/File::new @@ -222,7 +222,7 @@ java/io/File::new java/io/File::mkdir)) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def (<name> path) (do [! (try.with io.monad)] [?children (java/io/File::listFiles (java/io/File::new (ffi.as_string path)))] @@ -281,7 +281,7 @@ java/io/File::new (java/io/File::setLastModified (|> time_stamp instant.relative duration.millis ffi.as_long)))) - (~~ (with_template [<flag> <name>] + (,, (with_template [<flag> <name>] [(def (<name> path data) (do (try.with io.monad) [stream (java/io/FileOutputStream::new (java/io/File::new (ffi.as_string path)) (ffi.as_boolean <flag>)) @@ -388,7 +388,7 @@ (def separator js_separator) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def (<name> path) (do async.monad [?stats (with_async write! (Try Stats) @@ -420,7 +420,7 @@ (with_async write! (Try Any) (Fs::mkdir path (..any_callback write!) node_fs))))) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def (<name> path) (do [! (try.with async.monad)] [subs (with_async write! (Try (Array ffi.String)) @@ -494,7 +494,7 @@ (Fs::utimes path when when (..any_callback write!) node_fs)))) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def (<name> path data) (with_async write! (Try Any) (<method> path (Buffer::from data) (..any_callback write!) @@ -554,7 +554,7 @@ (def separator ..python_separator) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def <name> (|>> <method> (io#each (|>> (try.else false)))))] @@ -566,7 +566,7 @@ (def make_directory os::mkdir) - (~~ (with_template [<name> <method>] + (,, (with_template [<name> <method>] [(def (<name> path) (let [! (try.with io.monad)] (|> path @@ -615,7 +615,7 @@ (let [when (|> time_stamp instant.relative duration.millis (i./ +1,000))] (os::utime path (..tuple [when when])))) - (~~ (with_template [<name> <mode>] + (,, (with_template [<name> <mode>] [(def (<name> path data) (do (try.with io.monad) [file (..open path <mode>) @@ -680,7 +680,7 @@ (def separator ..ruby_separator) - (~~ (with_template [<name> <test>] + (,, (with_template [<name> <test>] [(def <name> (|>> <test> (io#each (|>> (try.else false)))))] @@ -692,7 +692,7 @@ (def make_directory FileUtils::mkdir) - (~~ (with_template [<name> <test>] + (,, (with_template [<name> <test>] [(def (<name> path) (do [! (try.with io.monad)] [self (Dir::open path) @@ -719,11 +719,11 @@ [sub_directories RubyFile::directory?] )) - (~~ (with_template [<name> <pipeline>] + (,, (with_template [<name> <pipeline>] [(def <name> (let [! (try.with io.monad)] (|>> RubyFile::stat - (at ! each (`` (|>> (~~ (template.spliced <pipeline>))))))))] + (at ! each (`` (|>> (,, (template.spliced <pipeline>))))))))] [file_size [Stat::size .nat]] [last_modified [Stat::mtime @@ -758,7 +758,7 @@ Time::at)] (RubyFile::utime moment moment path))) - (~~ (with_template [<mode> <name>] + (,, (with_template [<mode> <name>] [(def (<name> path data) (do [! (try.with io.monad)] [file (RubyFile::open path <mode>) @@ -821,7 +821,7 @@ ... (`` (def (file path) ... (-> Path (File IO)) ... (implementation - ... (~~ (with_template [<name> <mode>] + ... (,, (with_template [<name> <mode>] ... [(def (<name> data) ... (do [! (try.with io.monad)] ... [outcome (..file_put_contents [path ("php pack" ..byte_array_format data) <mode>])] @@ -843,13 +843,13 @@ ... (def path ... path) - ... (~~ (with_template [<name> <ffi> <pipeline>] + ... (,, (with_template [<name> <ffi> <pipeline>] ... [(def (<name> _) ... (do [! (try.with io.monad)] ... [value (<ffi> [path])] ... (if (bit#= false (as Bit value)) ... (at io.monad in (exception.except ..cannot_find_file [path])) - ... (in (`` (|> value (~~ (template.spliced <pipeline>))))))))] + ... (in (`` (|> value (,, (template.spliced <pipeline>))))))))] ... [size ..filesize [.nat]] ... [last_modified ..filemtime [(i.* +1,000) duration.of_millis instant.absolute]] @@ -886,7 +886,7 @@ ... (def scope ... path) - ... (~~ (with_template [<name> <test> <constructor> <capability>] + ... (,, (with_template [<name> <test> <constructor> <capability>] ... [(def (<name> _) ... (do [! (try.with io.monad)] ... [children (..scandir [path])] @@ -923,7 +923,7 @@ ... (`` (def .public default ... (System IO) ... (implementation - ... (~~ (with_template [<name> <test> <constructor> <exception>] + ... (,, (with_template [<name> <test> <constructor> <exception>] ... [(def (<name> path) ... (do [! (try.with io.monad)] ... [verdict (<test> path)] @@ -1153,7 +1153,7 @@ (def separator separator) - (~~ (with_template [<method> <retrieve>] + (,, (with_template [<method> <retrieve>] [(def (<method> path) (|> store stm.read @@ -1179,7 +1179,7 @@ {try.#Failure error} (in {try.#Failure error}))))) - (~~ (with_template [<method> <tag>] + (,, (with_template [<method> <tag>] [(def (<method> path) (stm.commit! (do stm.monad |