Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] "List.index" or "List.unique" functions?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff@s...
Subject: Re: [Caml-list] List.rev
On Fri, 1 May 2004, skaller wrote:
> BTW: documentation that says a function is 'tail recursive'
> is misguided. That's an implementation detail of no
> possible use to a user of the function. The user may
> benefit from knowing the complexity of the function
> in terms of speed and auxilliary storage required.

You couldn't be more wrong. When your program crashes because you've blown
stack and you're embarassed as all hell (you never expected the user to run
with *that* big of an input) you remember that documentation and curse your
own carelessness, rather than the OCaml team.

Since Ocaml optimizes tail calls, that info *is* about auxiliary storage.

On the same point, it would be a good thing if OCaml had a better solution
to these "tail recursion modulo cons" issues than writing set_cdr using
Obj functions. Better means "in the language" here; I'm aware that various
libraries have implemented the set_cdr approach.

There's only a handful of things that bug me about the OCaml language, and
this  makes the list. I'd append it to the list, but it might raise an
exception ;-).


-- Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners