Newsgroups: fa.caml
From: Diego Olivier FERNANDEZ PONS <diego.fernandez_p...@etu.upmc.fr>
Date: Mon, 02 Oct 2006 15:31:34 UTC
Local: Mon, Oct 2 2006 11:31 am
Subject: Re: [Caml-list] More problems with memoization
Bonjour,
Quoting Jon Harrop <j...@ffconsultancy.com>: > I believe you want to "untie the knot" of recursion, creating an Your solution is similar to Andrej Brauer's one which is exactly what > higher-order, auxiliary fibonacci function fib_aux that accepts the > recursive call as an argument: > # let rec fib_aux fib = function [...] I was trying to avoid because it is too much intrusive. When you break the recursion in two functions you change the type of [fib] from [fib : int -> int] to [fib : (int -> int) -> int -> int)]. In my first example you keep the type of [fib] and add a second When you compare your solution with what I am trying to do you see let rec fib = function transformed into let rec fib = function The latter could even be done automatically by a source to source Diego Olivier _______________________________________________ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||