From 1643be20cb10baf3cabcab502f0013b7faebe322 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Jun 2022 20:05:43 -0400 Subject: Generalized macro-let. --- lux-lua/source/program.lux | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'lux-lua') 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 [ (these (with_expansions [$var_args (_.var "...") $str_rel_to_abs (_.var "_utf8_str_rel_to_abs") $decode (_.var "_utf8_decode")] - (template.let [(!int ) - [(_.int (.int (hex )))] - - (!&| ) - [(|> - (_.bit_and (!int )) - (_.bit_or (!int )))] - - (!&|< ) - [(|> - (_.bit_shr (_.int )) - (_.bit_and (!int )) - (_.bit_or (!int )))]] + (local.let [!int (template (_ ) + [(_.int (.int (hex )))]) + !&| (template (_ ) + [(|> + (_.bit_and (!int )) + (_.bit_or (!int )))]) + !&|< (template (_ ) + [(|> + (_.bit_shr (_.int )) + (_.bit_and (!int )) + (_.bit_or (!int )))])] (these (def: rembulan//char (let [$buffer (_.var "buffer") $k (_.var "k") -- cgit v1.2.3