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/r/case.jvm.lux | 10 ++--- .../source/luxc/lang/translation/r/eval.jvm.lux | 44 +++++++++++----------- .../luxc/lang/translation/r/primitive.jvm.lux | 4 +- .../luxc/lang/translation/r/statement.jvm.lux | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/r') diff --git a/new-luxc/source/luxc/lang/translation/r/case.jvm.lux b/new-luxc/source/luxc/lang/translation/r/case.jvm.lux index 21d8f1def..3aa3d4a8a 100644 --- a/new-luxc/source/luxc/lang/translation/r/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/case.jvm.lux @@ -39,7 +39,7 @@ (let [method (if tail? runtimeT.product//right runtimeT.product//left)] - (method source (r.int (:! Int idx))))) + (method source (r.int (:coerce Int idx))))) valueO pathP)))) @@ -124,20 +124,20 @@ [_ ( value)] (meta/wrap (r.when (r.not (runtimeT.int//= (|> value ) cursor-top)) fail-pm!))) - ([#.Nat (<| runtimeT.int (:! Int))] + ([#.Nat (<| runtimeT.int (:coerce Int))] [#.Int runtimeT.int] - [#.Deg (<| runtimeT.int (:! Int))]) + [#.Deg (<| runtimeT.int (:coerce Int))]) (^template [ ] (^code ( (~ [_ (#.Nat idx)]))) - (meta/wrap (push-cursor! ( cursor-top (r.int (:! Int idx)))))) + (meta/wrap (push-cursor! ( cursor-top (r.int (:coerce Int idx)))))) (["lux case tuple left" runtimeT.product//left] ["lux case tuple right" runtimeT.product//right]) (^template [ ] (^code ( (~ [_ (#.Nat idx)]))) (meta/wrap ($_ r.then - (r.set! $temp (runtimeT.sum//get cursor-top (r.int (:! Int idx)) )) + (r.set! $temp (runtimeT.sum//get cursor-top (r.int (:coerce Int idx)) )) (r.if (r.= r.null (@@ $temp)) fail-pm! (push-cursor! (@@ $temp)))))) diff --git a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux index e3a255e41..eb20d73c5 100644 --- a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux @@ -51,21 +51,21 @@ (def: (parse-tuple lux-object host-object) (-> (-> Object (Error Any)) ListVector (Error Any)) - (let [size (:! Nat (ListVector::length [] host-object))] + (let [size (:coerce Nat (ListVector::length [] host-object))] (loop [idx +0 - output (:! (Array Any) (array.new size))] + output (:coerce (Array Any) (array.new size))] (if (n/< size idx) - (case (ListVector::getElementAsSEXP [(:! Int idx)] host-object) + (case (ListVector::getElementAsSEXP [(:coerce Int idx)] host-object) (#e.Error error) (#e.Error error) (#e.Success value) - (case (lux-object (:! Object value)) + (case (lux-object (:coerce Object value)) (#e.Error error) (#e.Error error) (#e.Success lux-value) - (recur (inc idx) (array.write idx (:! Any lux-value) output)))) + (recur (inc idx) (array.write idx (:coerce Any lux-value) output)))) (#e.Success output))))) (def: (parse-variant lux-object host-object) @@ -74,9 +74,9 @@ [tag (ListVector::get-field-sexp [//.variant-tag-field] host-object) flag (ListVector::get-field-sexp [//.variant-flag-field] host-object) value (ListVector::get-field-sexp [//.variant-value-field] host-object) - value (lux-object (:! Object value))] + value (lux-object (:coerce Object value))] (wrap [(|> tag - (:! IntArrayVector) + (:coerce IntArrayVector) (IntArrayVector::getElementAsInt [0]) (Long::intValue [])) (: Any @@ -90,35 +90,35 @@ (do e.Monad [high (ListVector::get-field-sexp [//.int-high-field] host-object) low (ListVector::get-field-sexp [//.int-low-field] host-object) - #let [get-int-32 (|>> (IntArrayVector::getElementAsInt [0]) (:! Nat)) - high (get-int-32 (:! IntArrayVector high)) - low (get-int-32 (:! IntArrayVector low))]] - (wrap (:! Int + #let [get-int-32 (|>> (IntArrayVector::getElementAsInt [0]) (:coerce Nat)) + high (get-int-32 (:coerce IntArrayVector high)) + low (get-int-32 (:coerce IntArrayVector low))]] + (wrap (:coerce Int (n/+ (|> high (bit.left-shift +32)) - (if (i/< 0 (:! Int low)) + (if (i/< 0 (:coerce Int low)) (|> low (bit.left-shift +32) (bit.logical-right-shift +32)) low)))))) (def: (lux-object host-object) (-> Object (Error Any)) (cond (host.instance? StringArrayVector host-object) - (#e.Success (StringArrayVector::getElementAsString [0] (:! StringArrayVector host-object))) + (#e.Success (StringArrayVector::getElementAsString [0] (:coerce StringArrayVector host-object))) (host.instance? LogicalArrayVector host-object) - (#e.Success (i/= 1 (LogicalArrayVector::getElementAsRawLogical [0] (:! LogicalArrayVector host-object)))) + (#e.Success (i/= 1 (LogicalArrayVector::getElementAsRawLogical [0] (:coerce LogicalArrayVector host-object)))) (host.instance? IntArrayVector host-object) - (#e.Success (IntArrayVector::getElementAsInt [0] (:! IntArrayVector host-object))) + (#e.Success (IntArrayVector::getElementAsInt [0] (:coerce IntArrayVector host-object))) (host.instance? DoubleArrayVector host-object) - (#e.Success (DoubleArrayVector::getElementAsDouble [0] (:! DoubleArrayVector host-object))) + (#e.Success (DoubleArrayVector::getElementAsDouble [0] (:coerce DoubleArrayVector host-object))) (host.instance? ListVector host-object) - (case (parse-int (:! ListVector host-object)) + (case (parse-int (:coerce ListVector host-object)) (#e.Error error) - (case (parse-variant lux-object (:! ListVector host-object)) + (case (parse-variant lux-object (:coerce ListVector host-object)) (#e.Error error) - (parse-tuple lux-object (:! ListVector host-object)) + (parse-tuple lux-object (:coerce ListVector host-object)) output output) @@ -127,14 +127,14 @@ output) ## 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" diff --git a/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux index a6101f749..ad89f2e31 100644 --- a/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/primitive.jvm.lux @@ -15,11 +15,11 @@ (def: #export translate-nat (-> Nat (Meta Expression)) - (|>> (:! Int) runtimeT.int meta/wrap)) + (|>> (:coerce Int) runtimeT.int meta/wrap)) (def: #export translate-deg (-> Deg (Meta Expression)) - (|>> (:! Int) runtimeT.int meta/wrap)) + (|>> (:coerce Int) runtimeT.int meta/wrap)) (def: #export translate-frac (-> Frac (Meta Expression)) diff --git a/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux index 62349abcf..e09410f40 100644 --- a/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/statement.jvm.lux @@ -34,7 +34,7 @@ (wrap []) tags - (moduleL.declare-tags tags (macro.export? metaV) (:! Type expressionV))) + (moduleL.declare-tags tags (macro.export? metaV) (:coerce Type expressionV))) (wrap [])) #let [_ (log! (format "DEF " (%ident def-ident)))]] (wrap [])) -- cgit v1.2.3