From 71de092a045dc70ab1c9eead477cf1512b144a87 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 12 Jan 2021 23:09:05 -0400 Subject: Raise error when trying to use deprecated fields/method/classes in JVM. --- lux-python/source/program.lux | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'lux-python') diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 2acae70d3..bdf2883ab 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -212,33 +212,32 @@ (def: (call_macro inputs lux macro) (-> (List Code) Lux org/python/core/PyFunction (Try (Try [Lux (List Code)]))) - (<| :assume - ..read - (org/python/core/PyFunction::__call__ (|> (host.array org/python/core/PyObject 2) - (host.array_write 0 (..to_host inputs)) - (host.array_write 1 (..to_host lux))) - macro))) + (:assume + (do try.monad + [expansion (host.try (org/python/core/PyFunction::__call__ (|> (host.array org/python/core/PyObject 2) + (host.array_write 0 (..to_host inputs)) + (host.array_write 1 (..to_host lux))) + macro))] + (..read expansion)))) (def: (expander macro inputs lux) Expander (case (ensure_macro macro) (#.Some macro) - (case (call_macro inputs lux macro) + (case (..call_macro inputs lux macro) (#try.Success output) (|> output (:coerce org/python/core/PyObject) ..read (:coerce (Try (Try [Lux (List Code)])))) - (#try.Failure try) - (#try.Failure try)) + (#try.Failure error) + (#try.Failure error)) #.None (exception.throw ..cannot_apply_a_non_function (:coerce java/lang/Object macro))) ) -(def: separator "___") - (def: host (IO (Host (_.Expression Any) (_.Statement Any))) (io (let [interpreter (org/python/util/PythonInterpreter::new) -- cgit v1.2.3