caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alan Falloon <Al.Falloon@synopsys.COM>
To: Michael Wohlwend <micha-1@fantasymail.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] recursive or loop
Date: Tue, 07 Mar 2006 11:02:43 -0500	[thread overview]
Message-ID: <440DAEA3.1000204@synopsys.com> (raw)
In-Reply-To: <200603062222.49613.micha-1@fantasymail.de>

Michael Wohlwend wrote:
> On Monday 06 March 2006 20:25, Anil Madhavapeddy wrote:
>   
>> To answer your original question, I wouldn't get too religious about
>> recursive vs imperative styles; OCaml lets you choose and mix them,
>> so pick the one that gets the job done for you and move on to the
>> finer things in life :-)
>>     
>
> yop, that's true; it's just that in my case the recursive version is pretty 
> nice :-)
>   
If you can easily convert it to a tail-recursive function, then you 
don't need to record any stack info, and its as easy as recording the 
current arguments like Jon Harrop pointed out.

Converting a recursive function to a tail-recursive one is as hard as 
converting it to an interative algorithm: the two forms are pretty much 
the same.

--
Alan Falloon


  reply	other threads:[~2006-03-07 16:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-06 17:25 Jonathan Harrop
2006-03-06 18:25 ` Michael Wohlwend
2006-03-06 18:31   ` Thomas Fischbacher
2006-03-08 19:07     ` Matthew O'Connor
2006-03-08 21:56       ` Thomas Fischbacher
2006-03-08 22:10         ` Till Varoquaux
2006-03-08 22:13           ` Thomas Fischbacher
2006-03-08 23:28             ` Jon Harrop
2006-03-06 19:25   ` Anil Madhavapeddy
2006-03-06 21:22     ` Michael Wohlwend
2006-03-07 16:02       ` Alan Falloon [this message]
2006-03-08  7:53         ` Michael Wohlwend
  -- strict thread matches above, loose matches on Subject: below --
2006-03-06 13:33 Jonathan Harrop
2006-03-06 14:15 ` Thomas Fischbacher
2006-03-06 16:42   ` Michael Wohlwend

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=440DAEA3.1000204@synopsys.com \
    --to=al.falloon@synopsys.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=micha-1@fantasymail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).