The behaviour isn't wrong, its just not giving details of the exception. This particular recursion test is inevitably going to fail on the call to printTo, because if it has enough stack to get the printTo done then it has enough stack for another TST_printRecurse call.
So you get an (unlabelled) overflow exception on the printTo that breaks the camels back.
Hmm. Does Transcendence lisp support tail call recursion?
mmhh, I'm no programmer, and I have little understanding of recursion.
From my point of view, all that I want to know is how not to have Transcendence crash on my code.
Question: does it mean that the function loop is going to crash after 1944 loops ?
digdug wrote:Question: does it mean that the function loop is going to crash after 1944 loops ?
Pretty much, but it isnt due to the loop-like nature, but to the repeated nesting of function calls
If function1 calls function2 which calls function3 which calls
<I am not going to type ~2000 of these>
which calls function2000
then it will throw an exception (the game should continue, but the functions leading up to the exception will be aborted).
In a rough sense: when a function returns, it needs to know where to return to. That means storing the "return here" details for each function call, and that storage can run out of room. The exact time at which it runs out varies depending on circumstances. Working directly from the Debug Console, I got about 2050 recursions before the exception.
I'll see if I can figure out the kind of exception. Stack overflows trigger a different exception, so I can always generate a recursion problem message. This is low priority, however, probably something for later.