aboutsummaryrefslogtreecommitdiff
path: root/lux-ruby/source/program.lux
diff options
context:
space:
mode:
Diffstat (limited to 'lux-ruby/source/program.lux')
-rw-r--r--lux-ruby/source/program.lux128
1 files changed, 64 insertions, 64 deletions
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