I think the following example shows that in some cases recursion is
undesirable.

Jerry

>> testnr 10000000
== 50000005000000
>> testr 10000 0.0
** Internal Error: Stack overflow.
** Where: either n > 0 [testr n - 1 x + n]
>> testr 1000 0.0
== 500500

testnr: func [n]
[
   x: 0.0
   for i 1 n 1 [x: x + i]
   x
]

testr: func [n x]
[
   either n > 0 [testr n - 1 x + n] [return x]
]

Reply via email to