Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Anonymous-recursion/Dylan/anonymous-recursion.dylan
Normal file
13
Task/Anonymous-recursion/Dylan/anonymous-recursion.dylan
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
define function fib (n)
|
||||
when (n < 0)
|
||||
error("Can't take fibonacci of negative integer: %d\n", n)
|
||||
end;
|
||||
local method fib1 (n, a, b)
|
||||
if (n = 0)
|
||||
a
|
||||
else
|
||||
fib1(n - 1, b, a + b)
|
||||
end
|
||||
end;
|
||||
fib1(n, 0, 1)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue