diff options
author | Eduardo Julian | 2018-07-03 18:40:16 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-03 18:40:16 -0400 |
commit | d3f5e1f4baa667bc2eb72edd542cf5d8cd3924ce (patch) | |
tree | 2aa771401cce0d08276abc072b9d31e00a651f29 /new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux index 7d43e5460..3c590e8ee 100644 --- a/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux @@ -37,11 +37,11 @@ (def: (tuple lux-object host-object) (-> (-> Object (Error Any)) RubyArray (Error Any)) - (let [size (:! Nat (RubyArray::getLength [] host-object))] + (let [size (:coerce Nat (RubyArray::getLength [] host-object))] (loop [idx +0 - output (:! (Array Any) (array.new size))] + output (:coerce (Array Any) (array.new size))] (if (n/< size idx) - (case (RubyArray::get [(:! Int idx)] host-object) + (case (RubyArray::get [(:coerce Int idx)] host-object) #.None (recur (inc idx) output) @@ -56,13 +56,13 @@ (def: (variant lux-object host-object) (-> (-> Object (Error Any)) RubyHash (Error Any)) - (case [(RubyHash::get [(:! Object //.variant-tag-field)] host-object) - (RubyHash::get [(:! Object //.variant-flag-field)] host-object) - (RubyHash::get [(:! Object //.variant-value-field)] host-object)] + (case [(RubyHash::get [(:coerce Object //.variant-tag-field)] host-object) + (RubyHash::get [(:coerce Object //.variant-flag-field)] host-object) + (RubyHash::get [(:coerce Object //.variant-value-field)] host-object)] (^multi [(#.Some tag) ?flag (#.Some value)] [(lux-object value) (#.Some value)]) - (#e.Success [(Long::intValue [] (:! Long tag)) + (#e.Success [(Long::intValue [] (:coerce Long tag)) (: Any (case ?flag (#.Some _) "" #.None (host.null))) value]) @@ -81,28 +81,28 @@ (ex.return host-object) (host.instance? org/jruby/RubyArray host-object) - (tuple lux-object (:! RubyArray host-object)) + (tuple lux-object (:coerce RubyArray host-object)) (host.instance? org/jruby/RubyHash host-object) - (case (variant lux-object (:! RubyHash host-object)) + (case (variant lux-object (:coerce RubyHash host-object)) (#e.Success value) (#e.Success value) _ - (let [object-class (:! Text (Object::toString [] (Object::getClass [] (:! Object host-object)))) - text-representation (:! Text (Object::toString [] (:! Object host-object)))] + (let [object-class (:coerce Text (Object::toString [] (Object::getClass [] (:coerce Object host-object)))) + text-representation (:coerce Text (Object::toString [] (:coerce Object host-object)))] (ex.throw Unknown-Kind-Of-Host-Object (format object-class " --- " text-representation)))) ## else - (let [object-class (:! Text (Object::toString [] (Object::getClass [] (:! Object host-object)))) - text-representation (:! Text (Object::toString [] (:! Object host-object)))] + (let [object-class (:coerce Text (Object::toString [] (Object::getClass [] (:coerce Object host-object)))) + text-representation (:coerce Text (Object::toString [] (:coerce Object host-object)))] (ex.throw Unknown-Kind-Of-Host-Object (format object-class " --- " text-representation))) ))) (def: #export (eval code) (-> Expression (Meta Any)) (function (_ compiler) - (let [interpreter (|> compiler (get@ #.host) (:! //.Host) (get@ #//.interpreter))] + (let [interpreter (|> compiler (get@ #.host) (:coerce //.Host) (get@ #//.interpreter))] (case (interpreter code) (#e.Error error) (exec (log! (format "eval #e.Error\n" @@ -111,7 +111,7 @@ ((lang.throw Cannot-Evaluate error) compiler)) (#e.Success output) - (case (lux-object (:! Object output)) + (case (lux-object (:coerce Object output)) (#e.Success parsed-output) (exec ## (log! (format "eval #e.Success\n" ## "<< " code)) |