4 ms·
The syntax is not the same. This is an example from itzer/virgil [1]: def fib(i: int) -> int { if (i <= 1) return 1; return fib(i - 1) + fib(i - 2);
by conaclos 4y ago
The syntax is not the same.
This is an example from itzer/virgil [1]:
def fib(i: int) -> int {
if (i <= 1) return 1;
return fib(i - 1) + fib(i - 2);
}
And an example from munificent/vigil [2]:
def fib(n):
if n < 2:
result = n
else:
result = fib(n - 1) + fib(n - 2)
swear result >= 0
return result
[1] https://github.com/titzer/virgil/blob/master/doc/tutorial/Methods.md https://github.com/titzer/virgil/blob/master/doc/tutorial/Me...
[2] https://github.com/munificent/vigil https://github.com/munificent/vigil