int fact(int n) { | |
if (n > 0) return n * fact(n - 1); | |
else return 1; | |
} | |
def foo(int i) { | |
switch (i) { | |
case 42: return <selection>fact</selection>(5) | |
default: | |
return fact(7) | |
} | |
} | |
----- | |
int fact(int n) { | |
if (n > 0) return n * fact(n - 1); | |
else return 1; | |
} | |
def foo(int i) { | |
switch (i) { | |
case 42: | |
int result | |
if (5 > 0) result = 5 * fact(5 - 1); | |
else result = 1 | |
return result | |
default: | |
return fact(7) | |
} | |
} |