From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA32114 for caml-red; Wed, 2 Aug 2000 13:10:06 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04684 for ; Sat, 29 Jul 2000 19:23:40 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e6THNdj02989 for ; Sat, 29 Jul 2000 19:23:39 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id TAA02197; Sat, 29 Jul 2000 19:23:35 +0200 (MET DST) Date: Sat, 29 Jul 2000 19:23:34 +0200 From: Markus Mottl To: John BEPPU Cc: caml-list@inria.fr Subject: Re: help an o'caml beginner Message-ID: <20000729192334.A26830@miss.wu-wien.ac.at> References: <20000726115152.A6102@yukari.lineo.com> <20000727205627.B21080@miss.wu-wien.ac.at> <20000729110333.A657@yukari.lineo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000729110333.A657@yukari.lineo.com>; from beppu@lineo.com on Sat, Jul 29, 2000 at 11:03:33 -0600 Sender: weis@pauillac.inria.fr On Sat, 29 Jul 2000, John BEPPU wrote: > This one was faster than the C version I posted. It should be, because it computes the fibonacci function in logarithmic time, whereas the "usual" function does it in linear time (fib2). The "simple" fibonacci implementation (fib1) is even worse: exponential time. > The others were pretty close, too. I continue to > be impressed. I have a hard time believing fib3 > was created by a mechanical transformation... it > doesn't look anything like the other implementations. > I mean, I believe you as a matter of good faith, but > I'm amazed. No, the OCaml-code was not generated by automated transformations, but the techniques are known and presented in the reference I mentioned - I just took their "transformed" solution and translated it to OCaml. But it is principally possible to apply such transformation techniques to functional languages in general, because of their nice mathematical properties. Since implementing such transformation systems correctly is a fairly difficult task, there are not yet many around, and those that exist normally operate on simplified languages to make life for researchers easier... > > What does the keyword "in" mean? > It is just a keyword to prevent ambiguities when writing expressions. E.g.: let x = y z ... is not the same as let x = y in z ... Best regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl