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-cl/source/program.lux | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lux-cl') diff --git a/lux-cl/source/program.lux b/lux-cl/source/program.lux index 04df3b86d..ff6aff2e5 100644 --- a/lux-cl/source/program.lux +++ b/lux-cl/source/program.lux @@ -164,7 +164,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 (host_value value) @@ -173,7 +173,7 @@ (function (_ sub_value) (let [sub_value (as java/lang/Object sub_value)] (`` (<| (,, (with_template [ ] - [(case (ffi.is sub_value) + [(when (ffi.is sub_value) {.#Some sub_value} (`` (|> sub_value (,, (template.splice )))) @@ -208,7 +208,7 @@ [(org/armedbear/lisp/LispObject [] ( self [idx int]) org/armedbear/lisp/LispObject - (case (array.read! (|> idx java/lang/Integer::longValue (as Nat)) + (when (array.read! (|> idx java/lang/Integer::longValue (as Nat)) (as (Array java/lang/Object) value)) {.#Some sub} (to_sub sub) @@ -229,7 +229,7 @@ [tag (read (org/armedbear/lisp/LispObject::NTH +0 host_object)) value (read (org/armedbear/lisp/LispObject::NTH +2 host_object))] (wrap [(java/lang/Long::intValue (as java/lang/Long tag)) - (case (ffi.is org/armedbear/lisp/Nil (org/armedbear/lisp/LispObject::NTH +1 host_object)) + (when (ffi.is org/armedbear/lisp/Nil (org/armedbear/lisp/LispObject::NTH +1 host_object)) {.#Some _} (is Any (ffi.null)) @@ -244,7 +244,7 @@ output (as (Array Any) (array.new size))]) (if (n.< size idx) ... TODO: Start using "SVREF" instead of "elt" ASAP - (case (read (org/armedbear/lisp/LispObject::elt (.int idx) host_object)) + (when (read (org/armedbear/lisp/LispObject::elt (.int idx) host_object)) {try.#Failure error} {try.#Failure error} @@ -255,7 +255,7 @@ (def (read host_object) (Reader org/armedbear/lisp/LispObject) (`` (<| (,, (with_template [ ] - [(case (ffi.is host_object) + [(when (ffi.is host_object) {.#Some host_object} (`` (|> host_object (,, (template.splice )))) @@ -270,7 +270,7 @@ [org/armedbear/lisp/Nil [(pipe.new {try.#Success false} [])]] [org/armedbear/lisp/Closure [{try.#Success}]] [program/LuxADT [program/LuxADT::getValue {try.#Success}]])) - (case (ffi.is org/armedbear/lisp/Symbol host_object) + (when (ffi.is org/armedbear/lisp/Symbol host_object) {.#Some host_object} (if (same? (org/armedbear/lisp/Symbol::T) host_object) {try.#Success true} @@ -294,7 +294,7 @@ (def (expander macro inputs lux) Expander - (case (ensure_macro macro) + (when (ensure_macro macro) {.#Some macro} (call_macro inputs lux macro) -- cgit v1.2.3