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/scheme | |
parent | bfd2d6c203042dfddb0ce29db3696365fe213314 (diff) |
- Re-named ":!" to ":coerce".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/scheme')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux | 40 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux | 2 |
2 files changed, 21 insertions, 21 deletions
diff --git a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux index 362deee4a..72c58587c 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux @@ -60,21 +60,21 @@ (def: (parse-tuple lux-object host-object) (-> (-> Object (Error Any)) (FVector Object) (Error Any)) - (let [size (:! Nat (FVector::getBufferLength [] host-object))] + (let [size (:coerce Nat (FVector::getBufferLength [] host-object))] (loop [idx +0 - output (:! (Array Any) (array.new size))] + output (:coerce (Array Any) (array.new size))] (if (n/< size idx) - (case (lux-object (FVector::get [(:! Int idx)] host-object)) + (case (lux-object (FVector::get [(:coerce Int idx)] host-object)) (#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: (variant tag flag value) (-> Nat Bool Any Any) - [(Long::intValue [] (:! Long tag)) + [(Long::intValue [] (:coerce Long tag)) (: Any (if flag //.unit @@ -83,24 +83,24 @@ (def: (to-text value) (-> Any Text) - (let [value-text (:! Text (Object::toString [] (:! Object value))) - class-text (:! Text (Object::toString [] (Object::getClass [] (:! Object value))))] + (let [value-text (:coerce Text (Object::toString [] (:coerce Object value))) + class-text (:coerce Text (Object::toString [] (Object::getClass [] (:coerce Object value))))] (format value-text " : " class-text))) (def: (parse-variant lux-object host-object) (-> (-> Object (Error Any)) Pair (Error Any)) (let [variant-tag (Pair::getCar [] host-object)] (if (and (host.instance? gnu/mapping/SimpleSymbol variant-tag) - (text/= //.variant-tag (Symbol::getName [] (:! Symbol variant-tag)))) + (text/= //.variant-tag (Symbol::getName [] (:coerce Symbol variant-tag)))) (do e.Monad<Error> - [#let [host-object (:! Pair (Pair::getCdr [] host-object))] + [#let [host-object (:coerce Pair (Pair::getCdr [] host-object))] tag (lux-object (Pair::getCar [] host-object)) - #let [host-object (:! Pair (Pair::getCdr [] host-object))] + #let [host-object (:coerce Pair (Pair::getCdr [] host-object))] #let [flag (host.instance? java/lang/String (Pair::getCar [] host-object))] value (lux-object (Pair::getCdr [] host-object))] - (wrap (..variant (:! Nat tag) flag value))) - (ex.throw invalid-variant (:! Text (Object::toString [] (:! Object host-object))))))) + (wrap (..variant (:coerce Nat tag) flag value))) + (ex.throw invalid-variant (:coerce Text (Object::toString [] (:coerce Object host-object))))))) (def: (lux-object host-object) (-> Object (Error Any)) @@ -109,32 +109,32 @@ (#e.Success host-object) (host.instance? gnu/math/IntNum host-object) - (#e.Success (IntNum::longValue [] (:! IntNum host-object))) + (#e.Success (IntNum::longValue [] (:coerce IntNum host-object))) (host.instance? gnu/math/DFloNum host-object) - (#e.Success (DFloNum::doubleValue [] (:! DFloNum host-object))) + (#e.Success (DFloNum::doubleValue [] (:coerce DFloNum host-object))) (host.instance? gnu/lists/FString host-object) - (#e.Success (FString::toString [] (:! FString host-object))) + (#e.Success (FString::toString [] (:coerce FString host-object))) (host.instance? gnu/lists/FVector host-object) - (parse-tuple lux-object (:! (FVector Object) host-object)) + (parse-tuple lux-object (:coerce (FVector Object) host-object)) (host.instance? gnu/lists/EmptyList host-object) (#e.Success //.unit) (host.instance? gnu/lists/Pair host-object) - (parse-variant lux-object (:! Pair host-object)) + (parse-variant lux-object (:coerce Pair host-object)) ## 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/scheme/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux index 43e18cb85..aa1411c18 100644 --- a/new-luxc/source/luxc/lang/translation/scheme/statement.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/scheme/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 [])) |