diff options
author | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-12 00:07:08 -0400 |
commit | dda05bca0956af5e5b3875c4cc36e61aa04772e4 (patch) | |
tree | 0f8b27697d58ab5c8e41aba7c7c9f769d3800767 /lux-r | |
parent | d48270f43c404ba19ca04da2553455ecaaf2caba (diff) |
Made the "#" character great again!
Diffstat (limited to '')
-rw-r--r-- | lux-r/source/program.lux | 80 | ||||
-rw-r--r-- | lux-ruby/source/program.lux | 128 |
2 files changed, 104 insertions, 104 deletions
diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux index 990fb6dbc..45023fe70 100644 --- a/lux-r/source/program.lux +++ b/lux-r/source/program.lux @@ -188,9 +188,9 @@ ... (let [sub_value (:as java/lang/Object sub_value)] ... (`` (<| (~~ (template [<type> <then>] ... [(case (ffi.check <type> sub_value) - ... {#.Some sub_value} + ... {.#Some sub_value} ... (`` (|> sub_value (~~ (template.splice <then>)))) - ... #.None)] + ... {.#None})] ... [[java/lang/Object] [host_value]] ... [java/lang/Boolean [..host_bit]] @@ -362,7 +362,7 @@ (case (|> host_object (org/renjin/sexp/ListVector::get_field runtime.variant_flag_field) (ffi.check org/renjin/sexp/Null)) - {#.Some _} + {.#Some _} (: Any (ffi.null)) _ @@ -377,12 +377,12 @@ (|> host_object (org/renjin/sexp/ListVector::get_field runtime.i64_low_field) (ffi.check org/renjin/sexp/IntArrayVector))] - [{#.Some high} {#.Some low}] - {#try.Success (runtime.lux_i64 (org/renjin/sexp/SEXP::asInt high) + [{.#Some high} {.#Some low}] + {try.#Success (runtime.lux_i64 (org/renjin/sexp/SEXP::asInt high) (org/renjin/sexp/SEXP::asInt low))} _ - {#try.Failure ""})) + {try.#Failure ""})) (def: (read_tuple read host_object) (-> (Reader java/lang/Object) (Reader org/renjin/sexp/ListVector)) @@ -391,12 +391,12 @@ output (:as (Array Any) (array.new size))] (if (n.< size idx) (case (|> host_object (org/renjin/sexp/ListVector::get_index (.int idx)) (:as java/lang/Object) read) - {#try.Failure error} - {#try.Failure error} + {try.#Failure error} + {try.#Failure error} - {#try.Success member} + {try.#Success member} (recur (++ idx) (array.write! idx (:as Any member) output))) - {#try.Success output})))) + {try.#Success output})))) (def: (field_class field host_object) (-> Text org/renjin/sexp/ListVector Text) @@ -411,35 +411,35 @@ (exec ... ("lux io log" (exception.construct ..unknown_kind_of_object [host_object])) (`` (<| (case (ffi.check org/renjin/sexp/ListVector host_object) - {#.Some host_object} + {.#Some host_object} (<| (case (..read_variant read host_object) - {#try.Success output} - {#try.Success output} + {try.#Success output} + {try.#Success output} - {#try.Failure _}) + {try.#Failure _}) (case (..read_i64 host_object) - {#try.Success output} - {#try.Success output} + {try.#Success output} + {try.#Success output} - {#try.Failure _}) + {try.#Failure _}) (..read_tuple read host_object)) - #.None) + {.#None}) (~~ (template [<class> <post_processing>] [(case (ffi.check <class> host_object) - {#.Some host_object} + {.#Some host_object} (`` (|> host_object (~~ (template.splice <post_processing>)))) - #.None)] + {.#None})] - [org/renjin/sexp/StringArrayVector [org/renjin/sexp/StringVector::asString #try.Success]] - [org/renjin/sexp/IntArrayVector [org/renjin/sexp/SEXP::asInt #try.Success]] + [org/renjin/sexp/StringArrayVector [org/renjin/sexp/StringVector::asString {try.#Success}]] + [org/renjin/sexp/IntArrayVector [org/renjin/sexp/SEXP::asInt {try.#Success}]] [org/renjin/sexp/LogicalArrayVector [org/renjin/sexp/LogicalVector::asLogical org/renjin/sexp/Logical::toBooleanStrict - #try.Success]] - [org/renjin/sexp/Closure [#try.Success]] - ... [org/armedbear/lisp/DoubleFloat [org/armedbear/lisp/DoubleFloat::doubleValue #try.Success]] - ... [program/LuxADT [program/LuxADT::getValue #try.Success]] + {try.#Success}]] + [org/renjin/sexp/Closure [{try.#Success}]] + ... [org/armedbear/lisp/DoubleFloat [org/armedbear/lisp/DoubleFloat::doubleValue {try.#Success}]] + ... [program/LuxADT [program/LuxADT::getValue {try.#Success}]] )) ... else (exception.throw ..unknown_kind_of_object [host_object]) @@ -458,10 +458,10 @@ (org/renjin/sexp/PairList$Builder::add (..host_value lux)) org/renjin/sexp/PairList$Builder::build (:as org/renjin/sexp/PairList))) - {#try.Success r_inputs} + {try.#Success r_inputs} r_inputs - {#try.Failure error} + {try.#Failure error} (exec ("lux io log" error) (panic! error)))) @@ -481,10 +481,10 @@ (def: (expander interpreter macro inputs lux) (-> org/renjin/script/RenjinScriptEngine Expander) (case (ensure_macro macro) - {#.Some macro} + {.#Some macro} (call_macro interpreter inputs lux macro) - #.None + {.#None} (exception.throw ..cannot_apply_a_non_function [(:as java/lang/Object macro)]))) (def: host @@ -542,11 +542,11 @@ (do io.monad [[interpreter host] ..host] (wrap [interpreter - [#platform.&file_system (file.async file.default) - #platform.host host - #platform.phase r.generate - #platform.runtime runtime.generate - #platform.write (|>> _.code (\ utf8.codec encoded))]]))) + [platform.#&file_system (file.async file.default) + platform.#host host + platform.#phase r.generate + platform.#runtime runtime.generate + platform.#write (|>> _.code (\ utf8.codec encoded))]]))) (def: (program context program) (Program _.Expression _.Expression) @@ -569,7 +569,7 @@ (:as Try) (exec ("lux io log" "TODO: Extender") - {#try.Failure "TODO: Extender"}))) + {try.#Failure "TODO: Extender"}))) @.r (def: (extender handler) @@ -593,10 +593,10 @@ (do io.monad [[interpreter platform] ..platform] (exec (do promise.monad - [_ (/.compiler [#/static.host @.r - #/static.host_module_extension extension - #/static.target (/cli.target service) - #/static.artifact_extension extension] + [_ (/.compiler [/static.#host @.r + /static.#host_module_extension extension + /static.#target (/cli.target service) + /static.#artifact_extension extension] (..expander interpreter) analysis.bundle (io.io platform) diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index 37713dfdb..c8fc1b49e 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -239,17 +239,17 @@ (array.empty size))] (if (n.< size idx) (case (org/jruby/RubyArray::get (.int idx) host_object) - #.None + {.#None} (recur (++ idx) output) - {#.Some value} + {.#Some value} (case (read value) - {#try.Failure error} - {#try.Failure error} + {try.#Failure error} + {try.#Failure error} - {#try.Success lux_value} + {try.#Success lux_value} (recur (++ idx) (array.write! idx lux_value output)))) - {#try.Success output})))) + {try.#Success output})))) (exception: (unknown_kind_of_object [object java/lang/Object]) (exception.report @@ -261,16 +261,16 @@ (case [(org/jruby/RubyHash::get (:as java/lang/String runtime.variant_tag_field) host_object) (org/jruby/RubyHash::get (:as java/lang/String runtime.variant_flag_field) host_object) (org/jruby/RubyHash::get (:as java/lang/String runtime.variant_value_field) host_object)] - (^multi [{#.Some tag} ?flag {#.Some value}] + (^multi [{.#Some tag} ?flag {.#Some value}] [(read value) - {#try.Success value}]) - {#try.Success [(:as Any (java/lang/Long::intValue (:as java/lang/Long tag))) + {try.#Success value}]) + {try.#Success [(:as Any (java/lang/Long::intValue (:as java/lang/Long tag))) (:as Any (case ?flag - {#.Some _} + {.#Some _} "" - #.None + {.#None} (ffi.null))) (:as Any value)]} @@ -285,21 +285,21 @@ (exception.except ..nil_has_no_lux_representation [])) (~~ (template [<class> <post_processing>] [(case (ffi.check <class> host_object) - {#.Some typed_object} + {.#Some typed_object} (`` (|> typed_object (~~ (template.spliced <post_processing>)))) _)] - [java/lang/Boolean [#try.Success]] - [java/lang/Long [#try.Success]] - [java/lang/Double [#try.Success]] - [java/lang/String [#try.Success]] - [[java/lang/Object] [#try.Success]] + [java/lang/Boolean [{try.#Success}]] + [java/lang/Long [{try.#Success}]] + [java/lang/Double [{try.#Success}]] + [java/lang/String [{try.#Success}]] + [[java/lang/Object] [{try.#Success}]] [org/jruby/RubyArray [(read_tuple read)]] [org/jruby/RubyHash [(read_variant read)]] - [org/jruby/RubySymbol [#try.Success]] - [org/jruby/RubyProc [#try.Success]] - [org/jruby/java/proxies/JavaProxy [org/jruby/java/proxies/JavaProxy::getObject #try.Success]] + [org/jruby/RubySymbol [{try.#Success}]] + [org/jruby/RubyProc [{try.#Success}]] + [org/jruby/java/proxies/JavaProxy [org/jruby/java/proxies/JavaProxy::getObject {try.#Success}]] )) (exception.except ..unknown_kind_of_object [host_object]) ))) @@ -316,30 +316,30 @@ (-> (-> (Array java/lang/Object) org/jruby/runtime/builtin/IRubyObject) (-> java/lang/Object org/jruby/runtime/builtin/IRubyObject)) (<| (case (ffi.check [java/lang/Object] value) - {#.Some value} + {.#Some value} (|> value (:as (Array java/lang/Object)) lux_structure) - #.None) + {.#None}) (case (ffi.check java/lang/Boolean value) - {#.Some value} + {.#Some value} (org/jruby/RubyBoolean::newBoolean ..initial_ruby_runtime value) - #.None) + {.#None}) (case (ffi.check java/lang/Long value) - {#.Some value} + {.#Some value} (org/jruby/RubyFixnum::new ..initial_ruby_runtime value) - #.None) + {.#None}) (case (ffi.check java/lang/Double value) - {#.Some value} + {.#Some value} (org/jruby/RubyFloat::new ..initial_ruby_runtime value) - #.None) + {.#None}) (case (ffi.check java/lang/String value) - {#.Some value} + {.#Some value} (org/jruby/RubyString::newInternalFromJavaExternal ..initial_ruby_runtime value) - #.None) + {.#None}) (:as org/jruby/runtime/builtin/IRubyObject value))) (exception: (invalid_variant_access [field Text]) @@ -378,17 +378,17 @@ org/jruby/runtime/builtin/IRubyObject (let [member (ffi.read! 0 args)] (<| (case (ffi.check org/jruby/RubyFixnum member) - {#.Some member} + {.#Some member} (case (array.read! (org/jruby/RubyFixnum::getLongValue member) value) - {#.Some value} + {.#Some value} (wrapped_lux_value lux_structure value) - #.None + {.#None} (panic! (exception.error ..invalid_tuple_access [(org/jruby/RubyFixnum::getLongValue member)]))) - #.None) + {.#None}) (case (ffi.check org/jruby/RubyString member) - {#.Some member} + {.#Some member} (case (:as Text (org/jruby/RubyString::asJavaString member)) (^ (static runtime.variant_tag_field)) (|> value @@ -400,29 +400,29 @@ (^ (static runtime.variant_flag_field)) (case (array.read! 1 value) - #.None + {.#None} ..ruby_nil - {#.Some flag} + {.#Some flag} ..lux_unit) (^ (static runtime.variant_value_field)) (case (array.read! 2 value) - {#.Some value} + {.#Some value} (wrapped_lux_value lux_structure value) - #.None + {.#None} (panic! (exception.error ..nil_has_no_lux_representation []))) field (panic! (exception.error ..invalid_variant_access [field]))) - #.None) + {.#None}) (case (ffi.check org/jruby/RubyRange member) - {#.Some member} + {.#Some member} (case [(|> member (org/jruby/RubyRange::first thread_context) (ffi.check org/jruby/RubyFixnum)) (|> member (org/jruby/RubyRange::size thread_context) (ffi.check org/jruby/RubyFixnum))] - [{#.Some first} {#.Some size}] + [{.#Some first} {.#Some size}] (let [first (org/jruby/RubyFixnum::getLongValue first) size (org/jruby/RubyFixnum::getLongValue size)] (lux_structure (java/util/Arrays::copyOfRange value first (i.+ first size)))) @@ -430,7 +430,7 @@ _ (panic! (exception.error ..invalid_index (:as java/lang/Object member)))) - #.None) + {.#None}) (panic! (exception.error ..invalid_index (:as java/lang/Object member)))))))) (def: (lux_wrapper_equality value) @@ -448,10 +448,10 @@ org/jruby/runtime/builtin/IRubyObject (let [reference (ffi.read! 0 args)] (case (..read (:as java/lang/Object reference)) - {#try.Success reference} + {try.#Success reference} (org/jruby/RubyBoolean::newBoolean ..initial_ruby_runtime (same? (: Any reference) (: Any value))) - {#try.Failure error} + {try.#Failure error} (org/jruby/RubyBoolean::newBoolean ..initial_ruby_runtime false)))))) (def: (lux_wrapper_length value) @@ -508,7 +508,7 @@ (case (|> args (ffi.read! 0) (ffi.check org/jruby/RubySymbol)) - {#.Some method} + {.#Some method} (|> (case (|> method org/jruby/RubySymbol::asJavaString (:as Text)) @@ -523,7 +523,7 @@ false) (org/jruby/RubyBoolean::newBoolean ..initial_ruby_runtime)) - #.None + {.#None} (panic! (exception.error ..invalid_operation ["respond_to?"])))))) (exception: (unknown_method [method Text]) @@ -585,18 +585,18 @@ (def: (expander macro inputs lux) Expander (case (ensure_macro macro) - {#.Some macro} + {.#Some macro} (case (call_macro inputs lux macro) - {#try.Success output} + {try.#Success output} (|> output (:as java/lang/Object) ..read (:as (Try (Try [Lux (List Code)])))) - {#try.Failure error} - {#try.Failure error}) + {try.#Failure error} + {try.#Failure error}) - #.None + {.#None} (exception.except ..cannot_apply_a_non_function [(:as java/lang/Object macro)]))) (def: host @@ -689,10 +689,10 @@ _ org/jruby/runtime/Block]) org/jruby/runtime/builtin/IRubyObject (<| try.trusted - (let [inputs (array.list #.None inputs)]) + (let [inputs (array.list {.#None} inputs)]) (case inputs (^ (list)) - {#try.Success (host_phase partial_application phase)} + {try.#Success (host_phase partial_application phase)} (^ (list input/0)) (do try.monad @@ -792,12 +792,12 @@ (IO (Platform Register _.Expression _.Statement)) (do io.monad [host ..host] - (in [#platform.&file_system (file.async file.default) - #platform.host host - #platform.phase ruby.generate - #platform.runtime runtime.generate - #platform.phase_wrapper ..phase_wrapper - #platform.write (|>> _.code (\ utf8.codec encoded))]))) + (in [platform.#&file_system (file.async file.default) + platform.#host host + platform.#phase ruby.generate + platform.#runtime runtime.generate + platform.#phase_wrapper ..phase_wrapper + platform.#write (|>> _.code (\ utf8.codec encoded))]))) (def: (program context program) (Program _.Expression _.Statement) @@ -812,10 +812,10 @@ (program: [service /cli.service] (let [extension ".rb"] (exec (do async.monad - [_ (/.compiler [#/static.host @.ruby - #/static.host_module_extension extension - #/static.target (/cli.target service) - #/static.artifact_extension extension] + [_ (/.compiler [/static.#host @.ruby + /static.#host_module_extension extension + /static.#target (/cli.target service) + /static.#artifact_extension extension] ..expander analysis.bundle ..platform |