aboutsummaryrefslogtreecommitdiff
path: root/lux-lua
diff options
context:
space:
mode:
authorEduardo Julian2022-06-12 20:05:43 -0400
committerEduardo Julian2022-06-12 20:05:43 -0400
commit1643be20cb10baf3cabcab502f0013b7faebe322 (patch)
tree4b4f4619921bf5749e404e7f644e5dfe30d69055 /lux-lua
parent94c0bc5d12ed44540543bd6772d357baeb32bb45 (diff)
Generalized macro-let.
Diffstat (limited to 'lux-lua')
-rw-r--r--lux-lua/source/program.lux30
1 files changed, 14 insertions, 16 deletions
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index ab567ae31..b3af368bb 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -24,7 +24,7 @@
["[0]" list (.open: "[1]#[0]" monad)]]]
[macro
["^" pattern]
- ["[0]" template]
+ ["[0]" local]
["[0]" code]]
[math
[number (.only hex)
@@ -33,7 +33,7 @@
["[0]" world
["[0]" file]
["[1]/[0]" program]]
- ["@" target
+ ["@" target (.only)
["_" lua]]
[tool
["[0]" compiler
@@ -55,7 +55,7 @@
["[1]" lua]]]
[generation
["[0]" reference]
- ["[0]" lua
+ ["[0]" lua (.only)
["[0]" runtime]]]]]]
[default
["[0]" platform (.only Platform)]]
@@ -502,19 +502,17 @@
(with_expansions [<jvm> (these (with_expansions [$var_args (_.var "...")
$str_rel_to_abs (_.var "_utf8_str_rel_to_abs")
$decode (_.var "_utf8_decode")]
- (template.let [(!int <hex>)
- [(_.int (.int (hex <hex>)))]
-
- (!&| <or> <and> <raw>)
- [(|> <raw>
- (_.bit_and (!int <and>))
- (_.bit_or (!int <or>)))]
-
- (!&|< <or> <and> <shift> <raw>)
- [(|> <raw>
- (_.bit_shr (_.int <shift>))
- (_.bit_and (!int <and>))
- (_.bit_or (!int <or>)))]]
+ (local.let [!int (template (_ <hex>)
+ [(_.int (.int (hex <hex>)))])
+ !&| (template (_ <or> <and> <raw>)
+ [(|> <raw>
+ (_.bit_and (!int <and>))
+ (_.bit_or (!int <or>)))])
+ !&|< (template (_ <or> <and> <shift> <raw>)
+ [(|> <raw>
+ (_.bit_shr (_.int <shift>))
+ (_.bit_and (!int <and>))
+ (_.bit_or (!int <or>)))])]
(these (def: rembulan//char
(let [$buffer (_.var "buffer")
$k (_.var "k")