Re: recursive definition

Doug Currie, Flavors Technology, Inc. (e@flavors.com)
Tue, 23 Apr 1996 20:38:44 -0400

Message-Id: <v01540b04ada3284fdf2d@[204.5.215.14]>
Date: Tue, 23 Apr 1996 20:38:44 -0400
To: "QUERCIA Michel (T) Math" <querciam@l-carnot1.ac-dijon.fr>,
From: e@flavors.com (Doug Currie, Flavors Technology, Inc.)
Subject: Re: recursive definition

>let rec fib = remember(fun x ->
> if x < 2 then 1 else fib(x-1) + fib(x-2)
>);;
>EntrHe interactive:
>>..............remember(fun x ->
>> if x < 2 then 1 else fib(x-1) + fib(x-2)
>>).......
>Ce genre d'expressions n'est pas autorisH comme membre droit d'un "let
>rec".

How about:

#let rec fib x = remember(fun x ->
if x < 2 then 1 else fib(x-1) + fib(x-2)
) x ;;

e