Jump to content

Y combinator: Difference between revisions

m
imported>Thebeez
(Added uBasic/4tH version)
imported>Arakov
Line 2,724:
=={{header|Elena}}==
{{trans|Smalltalk}}
ELENA 46.x :
<syntaxhighlight lang="elena">import extensions;
Line 2,735:
public program()
{
var fib := YCombinator.fix::(f => (i => (i <= 1) ? i : (f(i-1) + f(i-2)) ));
var fact := YCombinator.fix::(f => (i => (i == 0) ? 1 : (f(i-1) * i) ));
console.printLine("fib(10)=",fib(10));
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.