From bc36487224f670c23002cc4575c0dba3e5dc1be1 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 15 Mar 2022 07:24:35 -0400 Subject: De-sigil-ification: ^ --- lux-python/source/program.lux | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'lux-python') diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 2d6c858aa..5404b13d4 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -25,6 +25,7 @@ ["[0]" array {"+" Array}] ["[0]" list ("[1]#[0]" functor)]]] ["[0]" macro + ["^" pattern] ["[0]" template] ["[0]" code]] [math @@ -174,16 +175,16 @@ (case [(org/python/core/PyObject::__getitem__ (ffi.as_int +0) host_object) (org/python/core/PyObject::__getitem__ (ffi.as_int +1) host_object) (org/python/core/PyObject::__getitem__ (ffi.as_int +2) host_object)] - (^or [{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}] - [(read tag) - {try.#Success tag}] - [(read value) - {try.#Success value}]) + (^.multi [{try.#Success tag} {try.#Success flag} {try.#Success value}] + [(read tag) + {try.#Success tag}] + [(read value) + {try.#Success value}]) {try.#Success [tag (: Any (case (ffi.check org/python/core/PyNone @@ -269,11 +270,11 @@ (in (loop [it it inputs inputs] (`` (`` (case inputs - (^ (list)) + (pattern (list)) (:as org/python/core/PyObject self) (~~ (template [] - [(^ (list (~~ (static.literals code.local_symbol (inputs/? ))))) + [(pattern (list (~~ (static.literals code.local_symbol (inputs/? ))))) (to_host ((:as (~~ (static.literal function.identity (function/? ))) it) (~~ (static.literals code.local_symbol (inputs/? )))))] @@ -286,8 +287,8 @@ [7] [8])) - (^ (list& (~~ (static.literals code.local_symbol (inputs/? 8))) - input/+)) + (pattern (list& (~~ (static.literals code.local_symbol (inputs/? 8))) + input/+)) (again ((:as (~~ (static.literal function.identity (function/? 8))) it) (~~ (static.literals code.local_symbol (inputs/? 8)))) input/+)))))))))))) -- cgit v1.2.3