[clean-list] Memory usage in recursion

Eddy Van Esch eva@xpeqt.com
Mon, 20 Nov 2000 13:45:41 +0100


Hi All,
As I understand from the Clean tutorial "Functional programming in Clean",
Clean uses quite a lot of recursion to implement certain functions.
What I know from other languages is that recursion usually makes extensive
use of the stack. When the code is assembled you usually see a number of
'pushes' and 'pops' to store and retrieve data on the stack.
As you all know the danger is that the depth of recursion depends on the
data to be processed by the function in question. Usually you don't know in
advance what the 'size' of the data will be and you don't know exactly how
deep the recursion will be. As a result of this, a 'stack overflow' can occur.
Is this also the case in Clean or is the data storage during recursion
handled in a different way?
Kind regards 
Eddy