diff options
author | Eduardo Julian | 2021-01-12 23:09:05 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-01-12 23:09:05 -0400 |
commit | 71de092a045dc70ab1c9eead477cf1512b144a87 (patch) | |
tree | 1f71aca655d867b748c430996d3687911b7537cc /lux-python | |
parent | 5dbf134346424602b0104d1f749c1a9eac6f21af (diff) |
Raise error when trying to use deprecated fields/method/classes in JVM.
Diffstat (limited to 'lux-python')
-rw-r--r-- | lux-python/source/program.lux | 21 |
1 files changed, 10 insertions, 11 deletions
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) |