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/js | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js')
3 files changed, 17 insertions, 17 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux index 94136f356..8019ded53 100644 --- a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux @@ -61,13 +61,13 @@ (^multi [(#.Some high) (#.Some low)] (and (host.instance? Number high) (host.instance? Number low)) - [[(Number::longValue [] (:! Number high)) - (Number::longValue [] (:! Number low))] + [[(Number::longValue [] (:coerce Number high)) + (Number::longValue [] (:coerce Number low))] [high low]]) - (#.Some (.int (n/+ (|> high (:! Nat) (bit.left-shift +32)) - (if (i/< 0 (:! Int low)) - (|> low (:! Nat) (bit.left-shift +32) (bit.logical-right-shift +32)) - (|> low (:! Nat)))))) + (#.Some (.int (n/+ (|> high (:coerce Nat) (bit.left-shift +32)) + (if (i/< 0 (:coerce Int low)) + (|> low (:coerce Nat) (bit.left-shift +32) (bit.logical-right-shift +32)) + (|> low (:coerce Nat)))))) _ #.None)) @@ -79,7 +79,7 @@ (JSObject::getMember [//.variant-value-field] js-object)] (^multi [(#.Some tag) ?flag (#.Some value)] (host.instance? Number tag) - [[(Number::intValue [] (:! Number tag)) + [[(Number::intValue [] (:coerce Number tag)) (lux-object value)] [tag (#.Some value)]]) (#.Some [tag (maybe.default (host.null) ?flag) value]) @@ -101,7 +101,7 @@ (#.Some member) (case (lux-object member) (#e.Success parsed-member) - (recur num-keys (inc idx) (array.write idx (:! Object parsed-member) output)) + (recur num-keys (inc idx) (array.write idx (:coerce Object parsed-member) output)) (#e.Error error) #.None) @@ -117,24 +117,24 @@ (ex.throw Null-Has-No-Lux-Representation "") (host.instance? Integer js-object) - (ex.return (Integer::longValue [] (:! Integer js-object))) + (ex.return (Integer::longValue [] (:coerce Integer js-object))) (or (host.instance? java/lang/Boolean js-object) (host.instance? java/lang/String js-object)) (ex.return js-object) (host.instance? Number js-object) - (ex.return (Number::doubleValue [] (:! Number js-object))) + (ex.return (Number::doubleValue [] (:coerce Number js-object))) (~~ (do-template [<interface> <method>] [(host.instance? <interface> js-object) - (ex.return (<method> [] (:! <interface> js-object)))] + (ex.return (<method> [] (:coerce <interface> js-object)))] [StructureValue StructureValue::getValue] [IntValue IntValue::getValue])) (host.instance? ScriptObjectMirror js-object) - (let [js-object (:! ScriptObjectMirror js-object)] + (let [js-object (:coerce ScriptObjectMirror js-object)] (case (int js-object) (#.Some value) (ex.return value) @@ -154,17 +154,17 @@ ## js-object ## else - (ex.throw Unknown-Kind-Of-JS-Object (Object::toString [] (:! Object js-object))))))) + (ex.throw Unknown-Kind-Of-JS-Object (Object::toString [] (:coerce Object js-object))))))) ## else - (ex.throw Unknown-Kind-Of-JS-Object (Object::toString [] (:! Object js-object)))))) + (ex.throw Unknown-Kind-Of-JS-Object (Object::toString [] (:coerce Object js-object)))))) (def: #export (eval code) (-> Expression (Meta Any)) (function (_ compiler) (case (|> compiler (get@ #.host) - (:! //.Host) + (:coerce //.Host) (get@ #//.interpreter) (ScriptEngine::eval [code])) (#e.Error error) diff --git a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux index 305f46adf..5fedc9a9e 100644 --- a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux @@ -31,7 +31,7 @@ (def: deg-to-nat (-> Deg Nat) - (|>> (:! Nat))) + (|>> (:coerce Nat))) (def: #export translate-deg (-> Deg (Meta Expression)) diff --git a/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux index 849ae76c2..317193691 100644 --- a/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux @@ -33,7 +33,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 [])) |