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
OCaml troll on Slashdot
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-03-18 (00:04)
From: David Brown <caml-list2@d...>
Subject: Re: [Caml-list] tail-recursion vs. no tail-recursion in list functions
On Thu, Mar 17, 2005 at 10:41:13PM +0100, Oliver Bandel wrote:

> IMHO this does not makes sense.
> Better checking listlength with List.length and then calling the
> needed function directly.
> Why using an integer counter... this introduces overhead.

List.length is O(n) and will be at least as much overhead as a counter kept
for the beginning portion of the list.