Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re:Tail Calls
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marc Hamann <marc@h...>
Subject: Re:Tail Calls

>I don't understand why the compiler don't do himself those transformations.
>Why is it so hard to take a non-tail-recursive-function and make it a 
>tail-recursive-one ?

Because in the general case that would change the intent of the program.

Imagine if you have a sequence of two expressions with side-effects, or 
with significant order (e.g. consing a value to a function that returns a 
list).  Changing the order automatically would have the wrong effect.

Boy, some people want computers to do ALL our thinking. ;-)

Marc