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-lua/source/program.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lux-lua') diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index c3acbb560..983f35ee0 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -231,7 +231,7 @@ (`` (<| (if (ffi.null? host_object) (exception.except ..nil_has_no_lux_representation [])) (~~ (template [ ] - [(case (ffi.check host_object) + [(case (ffi.as host_object) {.#Some typed_object} (|> typed_object ) @@ -245,7 +245,7 @@ [net/sandius/rembulan/ByteString (<| {try.#Success} net/sandius/rembulan/ByteString::decode)] [net/sandius/rembulan/runtime/LuaFunction {try.#Success}] )) - (case (ffi.check net/sandius/rembulan/impl/DefaultTable host_object) + (case (ffi.as net/sandius/rembulan/impl/DefaultTable host_object) {.#Some typed_object} (case (read_variant read typed_object) {try.#Failure error} @@ -344,7 +344,7 @@ "throws" [net/sandius/rembulan/runtime/ResolvedControlThrowable] (<| (..return %) (apply/* to_host - (ffi.as net/sandius/rembulan/runtime/LuaFunction self) + (ffi.is net/sandius/rembulan/runtime/LuaFunction self) (list (~~ (static.literals function.identity (..input/* )))) lux_function)))] @@ -362,7 +362,7 @@ "throws" [net/sandius/rembulan/runtime/ResolvedControlThrowable] (<| (..return %) (apply/* to_host - (ffi.as net/sandius/rembulan/runtime/LuaFunction self) + (ffi.is net/sandius/rembulan/runtime/LuaFunction self) (array.list {.#None} input/*) lux_function))) ))))) @@ -372,7 +372,7 @@ (def: (lux_structure to_host value) (-> (-> Any java/lang/Object) (Array java/lang/Object) LuxValue) - (<| (ffi.as LuxValue) + (<| (ffi.is LuxValue) (ffi.object [] net/sandius/rembulan/impl/DefaultTable [LuxValue] [] ... Methods @@ -394,7 +394,7 @@ (net/sandius/rembulan/impl/DefaultTable [] (rawget self [field java/lang/Object]) java/lang/Object - (case (ffi.check net/sandius/rembulan/ByteString field) + (case (ffi.as net/sandius/rembulan/ByteString field) {.#Some field} (case (ffi.of_string (net/sandius/rembulan/ByteString::decode field)) (pattern (static runtime.variant_tag_field)) @@ -402,7 +402,7 @@ {.#Some it} (|> it (as java/lang/Integer) - (ffi.as java/lang/Object)) + (ffi.is java/lang/Object)) {.#None} (undefined)) @@ -426,13 +426,13 @@ array.size .int ffi.as_long - (ffi.as java/lang/Object)) + (ffi.is java/lang/Object)) _ (panic! (exception.error ..unknown_kind_of_object [(as java/lang/Object field)]))) {.#None} - (case (ffi.check java/lang/Long field) + (case (ffi.as java/lang/Long field) {.#Some idx} (case (array.read! (|> idx ffi.of_long .nat --) value) {.#Some it} @@ -452,7 +452,7 @@ (def: ensure_function (-> Macro (Maybe net/sandius/rembulan/runtime/LuaFunction)) (|>> (as java/lang/Object) - (ffi.check net/sandius/rembulan/runtime/LuaFunction))) + (ffi.as net/sandius/rembulan/runtime/LuaFunction))) (type: Baggage [net/sandius/rembulan/StateContext @@ -785,7 +785,7 @@ (with_expansions [ (these (def: (to_host it) (-> Any java/lang/Object) (`` (<| (~~ (template [ ] - [(case (ffi.check (as java/lang/Object it)) + [(case (ffi.as (as java/lang/Object it)) {.#Some it} (as java/lang/Object ( [(as_expected it)])) -- cgit v1.2.3