caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re:Tail Calls
@ 2005-03-16  1:39 Marc Hamann
  0 siblings, 0 replies; only message in thread
From: Marc Hamann @ 2005-03-16  1:39 UTC (permalink / raw)
  To: caml-list


>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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-16  1:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-16  1:39 Re:Tail Calls Marc Hamann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).