% Sample: recurse
%
% Purpose: Demonstrate tail recursion via the recurse/* builtin.
%
%          Note that the stack depth remains constant when run
%          with the debug mode flag.
(
	(def fac-recursive #N :: (
		(def fac-r-inner #N,Acc :: (
			(if (== 0 N) (
				(Acc)
			) (else (
				(recurse (- N 1) (* N Acc))
			)))
		))
		(fac-r-inner N 1)
	))

	(print (fac-recursive 100))
)