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-lua/source/program.lux | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lux-lua/source') diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 56437b026..ac9e9d310 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -23,6 +23,7 @@ ["[0]" array {"+" Array}] ["[0]" list ("[1]#[0]" monad)]]] [macro + ["^" pattern] ["[0]" template] ["[0]" code]] [math @@ -186,9 +187,9 @@ (case [(net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_tag_field) host_object) (net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_flag_field) host_object) (net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_value_field) host_object)] - (^multi [{.#Some tag} ?flag {.#Some value}] - [(read value) - {try.#Success value}]) + (^.multi [{.#Some tag} ?flag {.#Some value}] + [(read value) + {try.#Success value}]) {try.#Success [(: Any (|> tag (:as Int) ffi.as_long @@ -295,11 +296,11 @@ (loop [lux_function abstraction input/* input/*] (`` (`` (case input/* - (^ (list)) + (pattern (list)) (in self) (~~ (template [] - [(^ (list (~~ (static.literals function.identity (..input/* ))))) + [(pattern (list (~~ (static.literals function.identity (..input/* ))))) (in (to_host ((:as (~~ (static.literal function.identity (..function/* ))) lux_function) (~~ (static.literals function.identity (..input/* ))))))] @@ -311,7 +312,7 @@ [5] )) - (^ (list& (~~ (static.literals function.identity (..input/* 5))) input/+)) + (pattern (list& (~~ (static.literals function.identity (..input/* 5))) input/+)) (again ((:as (~~ (static.literal function.identity (..function/* 5))) lux_function) (~~ (static.literals function.identity (..input/* 5)))) @@ -396,7 +397,7 @@ (case (ffi.check net/sandius/rembulan/ByteString field) {.#Some field} (case (ffi.of_string (net/sandius/rembulan/ByteString::decode field)) - (^ (static runtime.variant_tag_field)) + (pattern (static runtime.variant_tag_field)) (case (array.read! 0 value) {.#Some it} (|> it @@ -406,7 +407,7 @@ {.#None} (undefined)) - (^ (static runtime.variant_flag_field)) + (pattern (static runtime.variant_flag_field)) (case (array.read! 1 value) {.#Some _} (:as java/lang/Object "") @@ -414,7 +415,7 @@ {.#None} (ffi.null)) - (^ (static runtime.variant_value_field)) + (pattern (static runtime.variant_value_field)) (|> value (array.read! 2) maybe.trusted -- cgit v1.2.3