From d3f5e1f4baa667bc2eb72edd542cf5d8cd3924ce Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 3 Jul 2018 18:40:16 -0400 Subject: - Re-named ":!" to ":coerce". --- .../source/luxc/lang/translation/ruby/eval.jvm.lux | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux') 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)) -- cgit v1.2.3