Content deleted Content added
→Simpler way to do anonymous recursion?: new section |
|||
Line 294:
[[User:Wstomv|Wstomv]] ([[User talk:Wstomv|talk]]) 20:34, 26 August 2013 (UTC)
== Simpler way to do anonymous recursion? ==
Does this work? It doesn't involve a fixpoint combinator (or does it?).
<syntaxhighlight lang="cpp">
factorial_helper(function foo, integer n) {
if n=0 then
return 1;
else
return n * foo(foo, n - 1);
}
factorial(n) {
return factorial_helper(factorial_helper, n)
}
</syntaxhighlight>
If this is a valid way to do anonymous recursion, why do we need fixpoint combinators to do this?
|