From d44c33f397223f5d93c348cf2fab19d214915b8a Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Mon, 1 Apr 2024 16:24:18 -0700 Subject: [PATCH] Update defs. --- implementations/C/convert_defs.py | 1 + implementations/C/definitions.c | 4 ++-- implementations/C/defs.txt | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/implementations/C/convert_defs.py b/implementations/C/convert_defs.py index 320d4bd..03a6a88 100644 --- a/implementations/C/convert_defs.py +++ b/implementations/C/convert_defs.py @@ -36,6 +36,7 @@ first lshift rshift mod +stack rest'''.splitlines() diff --git a/implementations/C/definitions.c b/implementations/C/definitions.c index c37c560..5c94db9 100644 --- a/implementations/C/definitions.c +++ b/implementations/C/definitions.c @@ -216,7 +216,7 @@ init_defs(void) def_dupd_body = text_to_expression("[dup] dip"); def_dupdipd_body = text_to_expression("dup dipd"); def_dupdip_body = text_to_expression("dupd dip"); - def_enstacken_body = text_to_expression("stack [clear] dip"); + def_enstacken_body = text_to_expression("[] swaack"); def_first_two_body = text_to_expression("uncons first"); def_flatten_body = text_to_expression("<{} [concat] step"); def_fork_body = text_to_expression("[i] app2"); @@ -292,7 +292,7 @@ init_defs(void) def_uncons_body = text_to_expression("[first] dupdip rest"); def_unit_body = text_to_expression("[] cons"); def_unquoted_body = text_to_expression("[i] dip"); - def_unstack_body = text_to_expression("[[] swaack] dip swoncat swaack pop"); + def_unstack_body = text_to_expression("[enstacken] dip swoncat swaack pop"); def_unswons_body = text_to_expression("uncons swap"); def_while_body = text_to_expression("swap nulco dupdipd concat loop"); def_x_body = text_to_expression("dup i"); diff --git a/implementations/C/defs.txt b/implementations/C/defs.txt index 934989a..444b137 100644 --- a/implementations/C/defs.txt +++ b/implementations/C/defs.txt @@ -24,7 +24,7 @@ binary unary popd ccccons ccons ccons ccons cons cons choice [pop] [popd] branch -clear [] swaack pop +clear enstacken pop cleave fork popdd clop cleave popdd cmp [[>] swap] dipd [ifte] ccons [=] swons ifte @@ -42,7 +42,7 @@ dupdd [dup] dipd dupd [dup] dip dupdipd dup dipd dupdip dupd dip -enstacken stack [clear] dip +enstacken [] swaack first uncons pop first_two uncons first flatten <{} [concat] step @@ -106,6 +106,7 @@ spiral_next [[[abs] ii <=] [[<>] [pop !-] or] and] [[!-] [[++]] [[--]] ifte dip] split_at [drop] [take] clop split_list [take reverse] [drop] clop sqr dup mul +stack enstacken dup cons swaack pop stackd [stack] dip step_zero 0 roll> step stuncons stack uncons @@ -123,7 +124,7 @@ unary nullary popd uncons [first] dupdip rest unit [] cons unquoted [i] dip -unstack [[] swaack] dip swoncat swaack pop +unstack [enstacken] dip swoncat swaack pop unswons uncons swap while swap nulco dupdipd concat loop x dup i