aboutsummaryrefslogtreecommitdiff
path: root/lux-python
diff options
context:
space:
mode:
authorEduardo Julian2021-09-10 01:21:23 -0400
committerEduardo Julian2021-09-10 01:21:23 -0400
commitcd71a864ad5be13ed6ec6d046e0a2cb1087bdf94 (patch)
treeaf6366578f98f1a8e551f4da9f3ad230fd63a4dd /lux-python
parentef77466323f85a3d1b65b46a3deb93652ef22085 (diff)
Migrated variants to the new syntax.
Diffstat (limited to 'lux-python')
-rw-r--r--lux-python/source/program.lux56
1 files changed, 28 insertions, 28 deletions
diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux
index afb244311..4aa41e066 100644
--- a/lux-python/source/program.lux
+++ b/lux-python/source/program.lux
@@ -128,17 +128,17 @@
(array.empty size))]
(if (n.< size idx)
(case (org/python/core/PyObject::__getitem__ (.int idx) host_object)
- (#try.Failure try)
- (#try.Failure try)
+ {#try.Failure try}
+ {#try.Failure try}
- (#try.Success value)
+ {#try.Success value}
(case (read value)
- (#try.Failure try)
- (#try.Failure try)
+ {#try.Failure try}
+ {#try.Failure try}
- (#try.Success lux_value)
+ {#try.Success lux_value}
(recur (++ idx) (array.write! idx lux_value output))))
- (#try.Success output)))))
+ {#try.Success output}))))
(exception: (unknown_kind_of_object [object java/lang/Object])
(exception.report
@@ -149,26 +149,26 @@
(case [(org/python/core/PyObject::__getitem__ +0 host_object)
(org/python/core/PyObject::__getitem__ +1 host_object)
(org/python/core/PyObject::__getitem__ +2 host_object)]
- (^or [(#try.Failure try) _ _]
- [_ (#try.Failure try) _]
- [_ _ (#try.Failure try)])
- (#try.Failure try)
+ (^or [{#try.Failure try} _ _]
+ [_ {#try.Failure try} _]
+ [_ _ {#try.Failure try}])
+ {#try.Failure try}
- (^multi [(#try.Success tag) (#try.Success flag) (#try.Success value)]
+ (^multi [{#try.Success tag} {#try.Success flag} {#try.Success value}]
[(read tag)
- (#try.Success tag)]
+ {#try.Success tag}]
[(read value)
- (#try.Success value)])
- (#try.Success [tag
+ {#try.Success value}])
+ {#try.Success [tag
(: Any
(case (ffi.check org/python/core/PyNone
(:as java/lang/Object flag))
- (#.Some _)
+ {#.Some _}
(:as Any (ffi.null))
#.None
(:as Any synthesis.unit)))
- value])
+ value]}
_
(exception.except ..unknown_kind_of_object [(:as java/lang/Object host_object)])))
@@ -177,8 +177,8 @@
Translator
(`` (<| (~~ (template [<class> <processing>]
[(case (ffi.check <class> (:as <class> host_object))
- (#.Some host_object)
- (#try.Success (`` (|> host_object (~~ (template.spliced <processing>)))))
+ {#.Some host_object}
+ {#try.Success (`` (|> host_object (~~ (template.spliced <processing>))))}
_)]
@@ -198,7 +198,7 @@
))
(~~ (template [<class> <processing>]
[(case (ffi.check <class> host_object)
- (#.Some host_object)
+ {#.Some host_object}
(<| <processing> (:as org/python/core/PyObject) host_object)
_)]
@@ -207,7 +207,7 @@
[org/python/core/PyList (..read_tuple read)]
))
... (exception.except ..unknown_kind_of_object [(:as java/lang/Object host_object)])
- (#try.Success host_object))))
+ {#try.Success host_object})))
(exception: (cannot_apply_a_non_function [object java/lang/Object])
(exception.report
@@ -249,16 +249,16 @@
(def: (expander macro inputs lux)
Expander
(case (ensure_macro macro)
- (#.Some macro)
+ {#.Some macro}
(case (..call_macro inputs lux macro)
- (#try.Success output)
+ {#try.Success output}
(|> output
(:as org/python/core/PyObject)
..read
(:as (Try (Try [Lux (List Code)]))))
- (#try.Failure error)
- (#try.Failure error))
+ {#try.Failure error}
+ {#try.Failure error})
#.None
(exception.except ..cannot_apply_a_non_function (:as java/lang/Object macro)))))]
@@ -268,7 +268,7 @@
@.python
(def: (expander macro inputs lux)
Expander
- (#try.Success ((:as Macro' macro) inputs lux)))]))
+ {#try.Success ((:as Macro' macro) inputs lux)})]))
(with_expansions [<jvm> (def: host
(IO (Host (_.Expression Any) (_.Statement Any)))
@@ -281,10 +281,10 @@
execute! (: (-> (_.Statement Any) (Try Any))
(function (execute! input)
(case (org/python/util/PythonInterpreter::exec (_.code input) interpreter)
- (#try.Failure error)
+ {#try.Failure error}
(if (text.contains? "maximum recursion depth exceeded" error)
(execute! input)
- (#try.Failure error))
+ {#try.Failure error})
output
output)))]