From 4704799c37fbe929a31cff20988d96b56d091ec5 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 28 Apr 2020 11:05:19 -0700 Subject: [PATCH] Rename primrec to tailrec. --- .hgignore | 2 ++ docs/repl.py | 4 ++-- joy/library.py | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.hgignore b/.hgignore index c344983..ae3dec0 100644 --- a/.hgignore +++ b/.hgignore @@ -8,3 +8,5 @@ test/* gnu-prolog/thun venv build +Thun.egg-info +dist \ No newline at end of file diff --git a/docs/repl.py b/docs/repl.py index c255b47..5895f5e 100755 --- a/docs/repl.py +++ b/docs/repl.py @@ -68,7 +68,7 @@ treestep == swap [map] swoncat [TS1 [TS0] dip] dip genrec Q == [tuck / + 2 /] unary eps == [sqr - abs] nullary -K == [<] [popop swap pop] [popd [Q eps] dip] primrec +K == [<] [popop swap pop] [popd [Q eps] dip] tailrec @@ -77,7 +77,7 @@ incr_value == [[popd incr_at] unary] dip add_value == [+] cons dipd incr_step_count == [++] dip -F == [popop 5 >=] [roll< popop] [get_value incr_value add_value incr_step_count] primrec +F == [popop 5 >=] [roll< popop] [get_value incr_value add_value incr_step_count] tailrec G == [first % not] [first /] [rest [not] [popop 0]] [ifte] genrec diff --git a/joy/library.py b/joy/library.py index 1e83a7d..a6fa62e 100644 --- a/joy/library.py +++ b/joy/library.py @@ -245,7 +245,7 @@ make_generator == [codireco] ccons nullary == [stack] dinfrirst of == swap at pam == [i] map -primrec == [i] genrec +tailrec == [i] genrec product == 1 swap [*] step quoted == [unit] dip range == [0 <=] [1 - dup] anamorphism @@ -1067,7 +1067,7 @@ def genrec(stack, expression, dictionary): Primitive recursive functions are those where R2 == i. :: - P == [I] [T] [R] primrec + P == [I] [T] [R] tailrec == [I] [T] [R [P] i] ifte == [I] [T] [R P] ifte @@ -1423,7 +1423,7 @@ def times(stack, expression, dictionary): # -------------------------------------- # [P] nullary [Q [P] nullary] loop -# while == [pop i not] [popop] [dudipd] primrec +# while == [pop i not] [popop] [dudipd] tailrec #def while_(S, expression, dictionary): # '''[if] [body] while''' @@ -1629,7 +1629,7 @@ for name in (''' ## range == [0 <=] [1 - dup] anamorphism ## while == swap [nullary] cons dup dipd concat loop ## dupdipd == dup dipd -## primrec == [i] genrec +## tailrec == [i] genrec ## step_zero == 0 roll> step ## codireco == cons dip rest cons ## make_generator == [codireco] ccons