From 439179e37f427eea3b73560a484301105ecea9be Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 27 Dec 2023 16:15:52 -0500 Subject: [PATCH] lang: Remove duplicate test It's contents were identical to the stmtfunc-recursive-double.txtar test. --- .../stmtfunc-recursive-no-operators.txtar | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.txtar diff --git a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.txtar b/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.txtar deleted file mode 100644 index 9b962ead..00000000 --- a/lang/interpret_test/TestAstFunc2/stmtfunc-recursive-no-operators.txtar +++ /dev/null @@ -1,34 +0,0 @@ --- main.mcl -- -import "fmt" - -# recursive function (not supported!) -func sum1($in) { - if $in < 0 { - -1 * sum2(-1 * $in) - } else { - if $in == 0 { - 0 # terminate recursion - } else { - $in + sum2($in - 1) - } - } -} -func sum2($in) { - if $in < 0 { - -1 * sum1(-1 * $in) - } else { - if $in == 0 { - 0 # terminate recursion - } else { - $in + sum1($in - 1) - } - } -} - -$out1 = sum1(4) # 4 + 3 + 2 + 1 + 0 = 10 -$out2 = sum2(-5) # -5 + -4 + -3 + -2 + -1 + -0 = -15 - -test fmt.printf("sum1(4) is %d", $out1) {} -test fmt.printf("sum2(-5) is %d", $out2) {} --- OUTPUT -- -# err: errSetScope: recursive reference while setting scope: not a dag