caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Reporting on sucess/failure of tail recursion
@ 2005-12-02  9:09 Erik de Castro Lopo
  2005-12-02  9:13 ` [Caml-list] " Jonathan Roewen
  2005-12-02  9:29 ` basile
  0 siblings, 2 replies; 10+ messages in thread
From: Erik de Castro Lopo @ 2005-12-02  9:09 UTC (permalink / raw)
  To: caml-list

Hi all,

Say I have a file containing a number if Ocaml functions. 

We all know the advantages of tail recursive functions over non-tail
recursive ones and some of us know if a simple function is tail
recursice just by looking at it. However, for more complex functions
it would be really nice if there was a compiler mode that could print 
which recursive functions in a file were tail recursive and which were 
not.

Is there a way to do this? Does anyone else think this would be a useful
feature?

Cheers,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"I saw `cout' being shifted "Hello world" times to the left 
and stopped right there." -- Steve Gonedes


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [Caml-list] Reporting on sucess/failure of tail recursion
@ 2005-12-03  0:28 David Thomas
  2005-12-04  4:11 ` Andres Varon
  0 siblings, 1 reply; 10+ messages in thread
From: David Thomas @ 2005-12-03  0:28 UTC (permalink / raw)
  To: caml-list

Particularly with respect to list operations,
"non-tail-recursive" usually implies stack space used
is O(n) to the length of the list, whereas "tail
recursive" implies O(1).  I, for one, would love to
see these figures explicitly, instead.

--- skaller <skaller@users.sourceforge.net> wrote:

> What needs to be documented for a library function
is its 
> complexity (time/space etc). In this sense the
documentation
> of the C++ Standard Library should be taken as an
examplar.



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-12-04  4:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02  9:09 Reporting on sucess/failure of tail recursion Erik de Castro Lopo
2005-12-02  9:13 ` [Caml-list] " Jonathan Roewen
2005-12-02  9:25   ` Erik de Castro Lopo
2005-12-02  9:29 ` basile
2005-12-02 10:16   ` Erik de Castro Lopo
2005-12-02 15:17     ` Jean-Christophe Filliatre
2005-12-02 23:58       ` skaller
2005-12-02 10:45   ` David MENTRE
2005-12-03  0:28 David Thomas
2005-12-04  4:11 ` Andres Varon

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).