[clean-list] Recursive array algorithms - continued

Mike Rainey marainey@cs.indiana.edu
Mon, 19 Jul 2004 02:46:11 -0500


True, the recursive matrix multiply code is not syntactically tail-recursive.  
The syntax can be safely compiled away to reveal fast looping code, and I 
think that is what happens.  After making the following change, stack size 
remains constant.

mm::*{#Real} !MortonIx !MortonIx !MortonIx !Int -> *{#Real}

---> mm::!*{#Real} !MortonIx !MortonIx !MortonIx !Int -> *{#Real}

Does this mean Clean is clever enough to make mm tail-recursive?  I think so, 
but I'm not sure.  After looking at the clean-list archives, I found a couple 
threads dealing with the same problem, but in a different context.

Mike Rainey