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-python/source/program.lux | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lux-python') diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 6f145bbbd..25a2131c5 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -187,8 +187,8 @@ {try.#Success value}]) {try.#Success [tag (is Any - (case (ffi.check org/python/core/PyNone - (as java/lang/Object flag)) + (case (ffi.as org/python/core/PyNone + (as java/lang/Object flag)) {.#Some _} (as Any (ffi.null)) @@ -209,7 +209,7 @@ (def: (read host_object) Translator (`` (<| (~~ (template [ ] - [(case (ffi.check (as host_object)) + [(case (ffi.as (as host_object)) {.#Some host_object} {try.#Success (`` (|> host_object (~~ (template.spliced ))))} @@ -218,8 +218,8 @@ [LuxValue [LuxValue::value]] [org/python/core/PyNone [(pipe.new [] [])]] [org/python/core/PyBoolean [org/python/core/PyObject::__nonzero__]] - ... [org/python/core/PyInteger [(ffi.as org/python/core/PyObject) org/python/core/PyObject::asInt]] - [org/python/core/PyInteger [(ffi.as org/python/core/PyObject) + ... [org/python/core/PyInteger [(ffi.is org/python/core/PyObject) org/python/core/PyObject::asInt]] + [org/python/core/PyInteger [(ffi.is org/python/core/PyObject) ("jvm member invoke virtual" [] "org.python.core.PyObject" "asInt" []) "jvm object cast" (is (Primitive "java.lang.Integer"))]] @@ -231,7 +231,7 @@ [[java/lang/Object] [(|>)]] )) (~~ (template [ ] - [(case (ffi.check host_object) + [(case (ffi.as host_object) {.#Some host_object} (<| (as org/python/core/PyObject) host_object) @@ -319,12 +319,12 @@ (::super! [index']) {.#Some it} - (<| (case (ffi.check [java/lang/Object] (as java/lang/Object it)) + (<| (case (ffi.as [java/lang/Object] (as java/lang/Object it)) {.#Some it} (to_host it) {.#None}) - (case (ffi.check library/lux/Function (as java/lang/Object it)) + (case (ffi.as library/lux/Function (as java/lang/Object it)) {.#Some it} (pseudo_function to_host it) @@ -335,7 +335,7 @@ (def: (to_host it) (-> Any org/python/core/PyObject) (`` (<| (~~ (template [ ] - [(case (ffi.check (as java/lang/Object it)) + [(case (ffi.as (as java/lang/Object it)) {.#Some it} (as org/python/core/PyObject ( [it])) @@ -368,7 +368,7 @@ (def: python_function! (-> Any (Maybe org/python/core/PyFunction)) (|>> (as java/lang/Object) - (ffi.check org/python/core/PyFunction))) + (ffi.as org/python/core/PyFunction))) (exception: (cannot_apply_a_non_function [object java/lang/Object]) (exception.report -- cgit v1.2.3