From 9df5ff6abc6e95c766d1907c5a9fee00730e749a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 30 Mar 2022 15:25:06 -0400 Subject: Re-named ffi.as to "is", and ffi.check to "as", to line the names up with normal type-annotation macros. --- lux-scheme/source/program.lux | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lux-scheme/source') diff --git a/lux-scheme/source/program.lux b/lux-scheme/source/program.lux index 78d96e962..7d116dfb6 100644 --- a/lux-scheme/source/program.lux +++ b/lux-scheme/source/program.lux @@ -139,14 +139,14 @@ (def: (variant? value) (-> Any Bit) - (case (ffi.check [java/lang/Object] (as java/lang/Object value)) + (case (ffi.as [java/lang/Object] (as java/lang/Object value)) {.#Some array} ... TODO: Get rid of this coercion ASAP. (let [array (as (Array java/lang/Object) array)] (and (n.= 3 (array.size array)) (case (array.read! 0 array) {.#Some tag} - (case (ffi.check java/lang/Integer tag) + (case (ffi.as java/lang/Integer tag) {.#Some _} true @@ -248,7 +248,7 @@ (def: (lux_value value) (-> java/lang/Object java/lang/Object) - (<| (case (ffi.check [java/lang/Object] value) + (<| (case (ffi.as [java/lang/Object] value) {.#Some value} ... TODO: Get rid of the coercions below. (if (variant? value) @@ -275,7 +275,7 @@ (do try.monad [tag (read (gnu/lists/Pair::getCar host_object)) #let [host_object (as gnu/lists/Pair (gnu/lists/Pair::getCdr host_object)) - flag (case (ffi.check java/lang/Boolean (gnu/lists/Pair::getCar host_object)) + flag (case (ffi.as java/lang/Boolean (gnu/lists/Pair::getCar host_object)) {.#Some flag} (as Bit flag) @@ -302,7 +302,7 @@ (def: (read host_object) (Reader java/lang/Object) (`` (<| (~~ (template [] - [(case (ffi.check host_object) + [(case (ffi.as host_object) {.#Some host_object} {try.#Success host_object} @@ -312,7 +312,7 @@ [gnu/mapping/Procedure] [gnu/lists/U8Vector] )) (~~ (template [ ] - [(case (ffi.check host_object) + [(case (ffi.as host_object) {.#Some host_object} {try.#Success (<| host_object)} @@ -329,12 +329,12 @@ [program/VariantValue program/VariantValue::getValue] [program/TupleValue program/TupleValue::getValue] )) - (case (ffi.check gnu/lists/Pair host_object) + (case (ffi.as gnu/lists/Pair host_object) {.#Some host_object} (read_variant read host_object) {.#None}) - (case (ffi.check gnu/lists/FVector host_object) + (case (ffi.as gnu/lists/FVector host_object) {.#Some host_object} (read_tuple read (as (gnu/lists/FVector java/lang/Object) host_object)) @@ -344,7 +344,7 @@ (def: ensure_macro (-> Macro (Maybe gnu/mapping/Procedure)) - (|>> (as java/lang/Object) (ffi.check gnu/mapping/Procedure))) + (|>> (as java/lang/Object) (ffi.as gnu/mapping/Procedure))) (def: (expander macro inputs lux) Expander -- cgit v1.2.3