[EMAIL PROTECTED] wrote:
Jordan,
I calculate the Fibonnacci numbers without recursion using REBOL. For
example
fib 100
== 3.54224848179262E+20
How would you calculate it with recursion?
Jerry
fib: func [first second n] [
either n = 1 [first] [
either n = 2 [second] [
Brent,
I'm confused. You seem to say that
test: func [n /local sum] [sum: 0 for i 1 n 1 [sum: sum + i]]
is not functional since it contains an index. On the other you seem to say
it is functional in that the output depends only on the input without any
side effects.
Where did I go wrong?