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". --- .../luxc/lang/translation/common-lisp/eval.jvm.lux | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux index cb6f03d17..0108d2e83 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux @@ -42,8 +42,8 @@ ) (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 org/armedbear/lisp/LispObject) @@ -72,21 +72,21 @@ (def: (parse-tuple lux-object host-object) (-> (-> Object (Error Any)) SimpleVector (Error Any)) - (let [size (:! Nat (SimpleVector::length [] host-object))] + (let [size (:coerce Nat (SimpleVector::length [] 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 (SimpleVector::elt [(:! Int idx)] host-object)) + (case (lux-object (SimpleVector::elt [(: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 @@ -101,52 +101,52 @@ (-> (-> Object (Error Any)) Cons (Error Any)) (let [variant-tag (Cons::car host-object)] (if (and (host.instance? org/armedbear/lisp/Symbol variant-tag) - (text/= //.variant-tag (Symbol::getName [] (:! Symbol variant-tag)))) + (text/= //.variant-tag (Symbol::getName [] (:coerce Symbol variant-tag)))) (do e.Monad - [#let [host-object (:! Cons (Cons::cdr host-object))] + [#let [host-object (:coerce Cons (Cons::cdr host-object))] tag (lux-object (Cons::car host-object)) - #let [host-object (:! Cons (Cons::cdr host-object))] + #let [host-object (:coerce Cons (Cons::cdr host-object))] #let [flag (host.instance? org/armedbear/lisp/SimpleString (Cons::car host-object))] value (lux-object (Cons::cdr 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)) (cond (host.instance? org/armedbear/lisp/Bignum host-object) - (#e.Success (Bignum::longValue [] (:! Bignum host-object))) + (#e.Success (Bignum::longValue [] (:coerce Bignum host-object))) (host.instance? org/armedbear/lisp/Fixnum host-object) - (#e.Success (Fixnum::longValue [] (:! Fixnum host-object))) + (#e.Success (Fixnum::longValue [] (:coerce Fixnum host-object))) (host.instance? org/armedbear/lisp/DoubleFloat host-object) - (#e.Success (DoubleFloat::doubleValue [] (:! DoubleFloat host-object))) + (#e.Success (DoubleFloat::doubleValue [] (:coerce DoubleFloat host-object))) (host.instance? org/armedbear/lisp/Nil host-object) (#e.Success false) (host.instance? org/armedbear/lisp/Symbol host-object) - (if (is? Symbol::T (:! Symbol host-object)) + (if (is? Symbol::T (:coerce Symbol host-object)) (#e.Success true) - (ex.throw Unknown-Kind-Of-Host-Object (:! Object host-object))) + (ex.throw Unknown-Kind-Of-Host-Object (:coerce Object host-object))) (host.instance? org/armedbear/lisp/SimpleString host-object) - (#e.Success (SimpleString::getStringValue [] (:! SimpleString host-object))) + (#e.Success (SimpleString::getStringValue [] (:coerce SimpleString host-object))) (host.instance? org/armedbear/lisp/SimpleVector host-object) - (parse-tuple lux-object (:! SimpleVector host-object)) + (parse-tuple lux-object (:coerce SimpleVector host-object)) (host.instance? org/armedbear/lisp/Cons host-object) - (parse-variant lux-object (:! Cons host-object)) + (parse-variant lux-object (:coerce Cons host-object)) ## else - (ex.throw Unknown-Kind-Of-Host-Object (:! Object host-object)))) + (ex.throw Unknown-Kind-Of-Host-Object (:coerce Object host-object)))) (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" -- cgit v1.2.3