From 0f9c1f4eb4fcbabec313d13205ef81e47fd8456c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 10 Apr 2024 11:53:18 -0400 Subject: Add corecursive func test --- test/corecursive_func.tm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/corecursive_func.tm (limited to 'test') diff --git a/test/corecursive_func.tm b/test/corecursive_func.tm new file mode 100644 index 00000000..0ff92e53 --- /dev/null +++ b/test/corecursive_func.tm @@ -0,0 +1,14 @@ +func ping(x:Int)->[Text] + if x > 0 + return ["ping: {x}"] ++ pong(x-1) + else + return ["ping: {x}"] + +func pong(x:Int)->[Text] + if x > 0 + return ["pong: {x}"] ++ ping(x-1) + else + return ["pong: {x}"] + +>> ping(3) += ["ping: 3", "pong: 2", "ping: 1", "pong: 0"] -- cgit v1.2.3