Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Generation of streams is slow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-14 (19:02)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Generation of streams is slow

On Sat, Jul 14, 2001 at 11:08:09AM -0700, Alexander V. Voinov wrote:

>     h::(make_tail arg1 argN),
> that is
> 	CALL make_tail
> and change them to
> 	CALL make_tail
> the scope of tail recursion optimization would increase. But it's
> unlikely that this idea didn't come to developers. Which may mean that
> this [being not that simple] is impossible.

It supposes that the order of evaluation could be variable. If we
imagine a constructor C with 5 parameters. If we evalutate:

      C (a, b, c, d, e)

Here, the order of evaluation is a-b-c-d-e or e-d-c-b-a, I don't know,
but in some logical order. If the tail recursion is, say, on the third
parameter c, it supposes that a, b, d and e be evaluated before. And
what policy use if, say, d is another tail recursion?

In OCaml the evaluation order is not - supposed to be - specified. In
this case, it would less be specified, since it could change depending
on the parameters. Interesting... But I don't know if it is possible to
implement that in the code generation.

Bug reports:  FAQ:
To unsubscribe, mail  Archives: