From a107593b6b362fb68e409c9d7b79427776d137d7 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 1 Sep 2026 20:59:47 -0400 Subject: pit: Tail call optimization! --- pit/test/test6.pit | 7 ++++--- pit/test/test8.pit | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 pit/test/test8.pit (limited to 'pit/test') diff --git a/pit/test/test6.pit b/pit/test/test6.pit index 93e5860..cb04f22 100644 --- a/pit/test/test6.pit +++ b/pit/test/test6.pit @@ -1,5 +1,6 @@ (print! - (case 'bar - (foo 1) - (bar 2))) + ((case 'baz + (foo (lambda (x) (+ x 1))) + (bar (lambda (x) (+ x 2)))) + 3)) \ No newline at end of file diff --git a/pit/test/test8.pit b/pit/test/test8.pit new file mode 100644 index 0000000..3b41d7a --- /dev/null +++ b/pit/test/test8.pit @@ -0,0 +1,2 @@ +(defun! foo (x) (+ x 1)) +(foo 2) \ No newline at end of file -- cgit v1.3.1