Hi all

The use of recursive functions in REBOL is limited by the depth of the
recursion stack.  Here is a simple test of the depth using Core 2.4 on
Win98. The len? function gives the same result as the built-in length?
function, but uses recursion.

>> len?: func [s [series!]][either empty? :s [0][1 + len? s: next :s]]
>> len? array/initial 1115 1
== 1115
>> len? array/initial 1116 1
** Internal Error: Stack overflow.
** Where: either empty? :s [0] [1 + len? s: next :s]
>> len? array/initial 1115 1
== 1115

Apparently the stack allows for 1115 recursive calls.

Comments? Other examples?

-Larry

Reply via email to