aboutsummaryrefslogtreecommitdiff
path: root/lux-r/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lux-r/source/program.lux46
1 files changed, 23 insertions, 23 deletions
diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux
index 5e5523e83..a42c5f06d 100644
--- a/lux-r/source/program.lux
+++ b/lux-r/source/program.lux
@@ -183,7 +183,7 @@
(-> Any org/renjin/sexp/SEXP)
(let [## to_sub (: (-> Any org/armedbear/lisp/LispObject)
## (function (_ sub_value)
- ## (let [sub_value (:coerce java/lang/Object sub_value)]
+ ## (let [sub_value (:as java/lang/Object sub_value)]
## (`` (<| (~~ (template [<type> <then>]
## [(case (ffi.check <type> sub_value)
## (#.Some sub_value)
@@ -198,7 +198,7 @@
## [java/lang/String [org/armedbear/lisp/SimpleString::new]]
## ))
## ## else
- ## (:coerce org/armedbear/lisp/LispObject sub_value))))))
+ ## (:as org/armedbear/lisp/LispObject sub_value))))))
]
(`` (macro.log_expand_once!
(ffi.object []
@@ -217,7 +217,7 @@
## Methods
## (program/LuxADT
## [] (getValue self) java/lang/Object
- ## (:coerce java/lang/Object value))
+ ## (:as java/lang/Object value))
## (org/renjin/sexp/AbstractSEXP
## [] (eval self {context org/renjin/eval/Context} {environment org/renjin/sexp/Environment})
@@ -351,13 +351,13 @@
(do try.monad
[tag (|> host_object
(org/renjin/sexp/ListVector::get_field runtime.variant_tag_field)
- (:coerce java/lang/Object)
+ (:as java/lang/Object)
read)
value (|> host_object
(org/renjin/sexp/ListVector::get_field runtime.variant_value_field)
- (:coerce java/lang/Object)
+ (:as java/lang/Object)
read)]
- (wrap [(|> tag (:coerce java/lang/Long) java/lang/Long::intValue)
+ (wrap [(|> tag (:as java/lang/Long) java/lang/Long::intValue)
(case (|> host_object
(org/renjin/sexp/ListVector::get_field runtime.variant_flag_field)
(ffi.check org/renjin/sexp/Null))
@@ -387,14 +387,14 @@
(-> (Reader java/lang/Object) (Reader org/renjin/sexp/ListVector))
(let [size (.nat (org/renjin/sexp/ListVector::length host_object))]
(loop [idx 0
- output (:coerce (Array Any) (array.new size))]
+ output (:as (Array Any) (array.new size))]
(if (n.< size idx)
- (case (|> host_object (org/renjin/sexp/ListVector::get_index (.int idx)) (:coerce java/lang/Object) read)
+ (case (|> host_object (org/renjin/sexp/ListVector::get_index (.int idx)) (:as java/lang/Object) read)
(#try.Failure error)
(#try.Failure error)
(#try.Success member)
- (recur (inc idx) (array.write! idx (:coerce Any member) output)))
+ (recur (inc idx) (array.write! idx (:as Any member) output)))
(#try.Success output)))))
(def: (field_class field host_object)
@@ -403,7 +403,7 @@
(org/renjin/sexp/ListVector::get_field field)
java/lang/Object::getClass
java/lang/Object::toString
- (:coerce Text)))
+ (:as Text)))
(def: (read host_object)
(Reader java/lang/Object)
@@ -446,7 +446,7 @@
(def: ensure_macro
(-> Macro (Maybe org/renjin/sexp/Closure))
- (|>> (:coerce java/lang/Object) (ffi.check org/renjin/sexp/Closure)))
+ (|>> (:as java/lang/Object) (ffi.check org/renjin/sexp/Closure)))
(def: (call_macro interpreter inputs lux macro)
(-> org/renjin/script/RenjinScriptEngine (List Code) Lux org/renjin/sexp/Closure (Try (Try [Lux (List Code)])))
@@ -456,7 +456,7 @@
(org/renjin/sexp/PairList$Builder::add (..host_value inputs))
(org/renjin/sexp/PairList$Builder::add (..host_value lux))
org/renjin/sexp/PairList$Builder::build
- (:coerce org/renjin/sexp/PairList)))
+ (:as org/renjin/sexp/PairList)))
(#try.Success r_inputs)
r_inputs
@@ -474,8 +474,8 @@
(do try.monad
[raw_output (org/renjin/sexp/FunctionCall::eval r_context r_environment r_macro)
#let [_ ("lux io log" "@call_macro 5")]]
- (:coerce (Try (Try [Lux (List Code)]))
- (..read (:coerce java/lang/Object raw_output))))))
+ (:as (Try (Try [Lux (List Code)]))
+ (..read (:as java/lang/Object raw_output))))))
(def: (expander interpreter macro inputs lux)
(-> org/renjin/script/RenjinScriptEngine Expander)
@@ -484,7 +484,7 @@
(call_macro interpreter inputs lux macro)
#.None
- (exception.throw ..cannot_apply_a_non_function [(:coerce java/lang/Object macro)])))
+ (exception.throw ..cannot_apply_a_non_function [(:as java/lang/Object macro)])))
(def: host
(IO [org/renjin/script/RenjinScriptEngine
@@ -496,7 +496,7 @@
(do try.monad
[host_value (javax/script/ScriptEngine::eval (_.code code) interpreter)]
(read host_value))))]
- [(:coerce org/renjin/script/RenjinScriptEngine interpreter)
+ [(:as org/renjin/script/RenjinScriptEngine interpreter)
(: (Host _.Expression _.Expression)
(structure
(def: (evaluate! context code)
@@ -524,7 +524,7 @@
(wrap [global value definition]))))
(def: (ingest context content)
- (|> content (\ utf8.codec decode) try.assume (:coerce _.Expression)))
+ (|> content (\ utf8.codec decode) try.assume (:as _.Expression)))
(def: (re_learn context content)
(run! content))
@@ -555,17 +555,17 @@
(def: extender
Extender
## TODO: Stop relying on coercions ASAP.
- (<| (:coerce Extender)
+ (<| (:as Extender)
(function (@self handler))
- (:coerce Handler)
+ (:as Handler)
(function (@self name phase))
- (:coerce Phase)
+ (:as Phase)
(function (@self archive parameters))
- (:coerce Operation)
+ (:as Operation)
(function (@self state))
- (:coerce Try)
+ (:as Try)
try.assume
- (:coerce Try)
+ (:as Try)
(exec
("lux io log" "TODO: Extender")
(#try.Failure "TODO: Extender"))))