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/php/eval.jvm.lux | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/php/eval.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/php/eval.jvm.lux | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux index 54ec6abc2..4b954c4f1 100644 --- a/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/php/eval.jvm.lux @@ -29,8 +29,8 @@ (intValue [] Integer)) (exception: #export (Unknown-Kind-Of-Host-Object {host-object Object}) - (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)))] (format object-class " --- " text-representation))) (host.import php/runtime/Memory) @@ -63,18 +63,18 @@ (-> (-> Object (Error Any)) ArrayMemory (Error Any)) (let [size (ArrayMemory::size [] host-object)] (loop [idx 0 - output (: (Array Any) (array.new (:! Nat size)))] + output (: (Array Any) (array.new (:coerce Nat size)))] (if (i/< size idx) (let [value (|> host-object (ArrayMemory::get [(LongMemory::new [idx])]) - (:! ReferenceMemory) (ReferenceMemory::getValue []))] + (:coerce ReferenceMemory) (ReferenceMemory::getValue []))] (if (host.instance? php/runtime/memory/NullMemory value) (recur (inc idx) - (array.write (:! Nat idx) (host.null) output)) + (array.write (:coerce Nat idx) (host.null) output)) (do e.Monad<Error> [lux-value (lux-object value)] (recur (inc idx) - (array.write (:! Nat idx) lux-value output))))) + (array.write (:coerce Nat idx) lux-value output))))) (ex.return output))))) (def: (variant lux-object host-object) @@ -83,11 +83,11 @@ [variant-tag (lux-object (ArrayMemory::get [(StringMemory::new [//.variant-tag-field])] host-object)) variant-value (lux-object (ArrayMemory::get [(StringMemory::new [//.variant-value-field])] host-object))] (wrap (: Any - [(Long::intValue [] (:! Long variant-tag)) + [(Long::intValue [] (:coerce Long variant-tag)) (: Any (if (|> host-object (ArrayMemory::get [(StringMemory::new [//.variant-flag-field])]) - (:! ReferenceMemory) + (:coerce ReferenceMemory) (ReferenceMemory::getValue []) (host.instance? php/runtime/memory/NullMemory)) (host.null) @@ -103,21 +103,21 @@ (ex.return true) (host.instance? php/runtime/memory/LongMemory host-object) - (ex.return (LongMemory::toLong [] (:! LongMemory host-object))) + (ex.return (LongMemory::toLong [] (:coerce LongMemory host-object))) (host.instance? php/runtime/memory/DoubleMemory host-object) - (ex.return (DoubleMemory::toDouble [] (:! DoubleMemory host-object))) + (ex.return (DoubleMemory::toDouble [] (:coerce DoubleMemory host-object))) (host.instance? php/runtime/memory/StringMemory host-object) - (ex.return (StringMemory::toString [] (:! StringMemory host-object))) + (ex.return (StringMemory::toString [] (:coerce StringMemory host-object))) (host.instance? php/runtime/memory/ReferenceMemory host-object) - (lux-object (ReferenceMemory::getValue [] (:! ReferenceMemory host-object))) + (lux-object (ReferenceMemory::getValue [] (:coerce ReferenceMemory host-object))) (host.instance? php/runtime/memory/ArrayMemory host-object) - (if (ArrayMemory::isMap [] (:! ArrayMemory host-object)) - (variant lux-object (:! ArrayMemory host-object)) - (tuple lux-object (:! ArrayMemory host-object))) + (if (ArrayMemory::isMap [] (:coerce ArrayMemory host-object)) + (variant lux-object (:coerce ArrayMemory host-object)) + (tuple lux-object (:coerce ArrayMemory host-object))) ## else (ex.throw Unknown-Kind-Of-Host-Object host-object))) @@ -125,7 +125,7 @@ (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) ((lang.throw Cannot-Evaluate error) compiler) |