From 065e8a4d8122d4616b570496915d2c0e2c78cd6b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 11 Aug 2022 04:15:07 -0400 Subject: Re-named the "case" macro to "when". --- lux-r/source/program.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lux-r/source/program.lux') diff --git a/lux-r/source/program.lux b/lux-r/source/program.lux index 68f8ef9c8..ab60ff510 100644 --- a/lux-r/source/program.lux +++ b/lux-r/source/program.lux @@ -182,7 +182,7 @@ ... (def host_bit ... (-> Bit org/armedbear/lisp/LispObject) -... (|>> (pipe.case #0 (org/armedbear/lisp/Nil::NIL) +... (|>> (pipe.when #0 (org/armedbear/lisp/Nil::NIL) ... #1 (org/armedbear/lisp/Symbol::T)))) (def %%code @@ -195,7 +195,7 @@ ... (function (_ sub_value) ... (let [sub_value (as java/lang/Object sub_value)] ... (`` (<| (,, (with_template [ ] - ... [(case (ffi.as sub_value) + ... [(when (ffi.as sub_value) ... {.#Some sub_value} ... (`` (|> sub_value (,, (template.splice )))) ... {.#None})] @@ -367,7 +367,7 @@ (as java/lang/Object) read)] (wrap [(|> tag (as java/lang/Long) java/lang/Long::intValue) - (case (|> host_object + (when (|> host_object (org/renjin/sexp/ListVector::get_field runtime.variant_flag_field) (ffi.as org/renjin/sexp/Null)) {.#Some _} @@ -379,7 +379,7 @@ (def (read_i64 host_object) (Reader org/renjin/sexp/ListVector) - (case [(|> host_object + (when [(|> host_object (org/renjin/sexp/ListVector::get_field runtime.i64_high_field) (ffi.as org/renjin/sexp/IntArrayVector)) (|> host_object @@ -398,7 +398,7 @@ (loop (again [idx 0 output (as (Array Any) (array.new size))]) (if (n.< size idx) - (case (|> host_object (org/renjin/sexp/ListVector::get_index (.int idx)) (as java/lang/Object) read) + (when (|> host_object (org/renjin/sexp/ListVector::get_index (.int idx)) (as java/lang/Object) read) {try.#Failure error} {try.#Failure error} @@ -418,14 +418,14 @@ (Reader java/lang/Object) (exec ... (debug.log! (exception.construct ..unknown_kind_of_object [host_object])) - (`` (<| (case (ffi.as org/renjin/sexp/ListVector host_object) + (`` (<| (when (ffi.as org/renjin/sexp/ListVector host_object) {.#Some host_object} - (<| (case (..read_variant read host_object) + (<| (when (..read_variant read host_object) {try.#Success output} {try.#Success output} {try.#Failure _}) - (case (..read_i64 host_object) + (when (..read_i64 host_object) {try.#Success output} {try.#Success output} @@ -434,7 +434,7 @@ {.#None}) (,, (with_template [ ] - [(case (ffi.as host_object) + [(when (ffi.as host_object) {.#Some host_object} (`` (|> host_object (,, (template.splice )))) @@ -461,7 +461,7 @@ (-> org/renjin/script/RenjinScriptEngine (List Code) Lux org/renjin/sexp/Closure (Try (Try [Lux (List Code)]))) (let [_ (debug.log! "@call_macro 0") r_inputs (is org/renjin/sexp/PairList - (case (ffi.try (|> (org/renjin/sexp/PairList$Builder::new) + (when (ffi.try (|> (org/renjin/sexp/PairList$Builder::new) (org/renjin/sexp/PairList$Builder::add (..host_value inputs)) (org/renjin/sexp/PairList$Builder::add (..host_value lux)) org/renjin/sexp/PairList$Builder::build @@ -488,7 +488,7 @@ (def (expander interpreter macro inputs lux) (-> org/renjin/script/RenjinScriptEngine Expander) - (case (ensure_macro macro) + (when (ensure_macro macro) {.#Some macro} (call_macro interpreter inputs lux macro) -- cgit v1.2.3