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] strange tail recursion behavior by caml compiler
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] strange tail recursion behavior by caml compiler
> So here's the problem.  When I write listbest like
> this, it's not tail recursive.  I get stack overflow
> exceptions on long lists:

Your two versions of listbest are both tail-recursive, even on a
register-starved x86 processor, as shown by a quick look at the asm
generated by ocamlopt. Either you've simplified your code a
little too much before posting, or the stack overflow comes from
elsewhere in your code.

- Xavier Leroy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: