From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: John BEPPU <beppu@lineo.com>
Cc: caml-list@inria.fr
Subject: Re: help an o'caml beginner
Date: Sat, 29 Jul 2000 19:23:34 +0200 [thread overview]
Message-ID: <20000729192334.A26830@miss.wu-wien.ac.at> (raw)
In-Reply-To: <20000729110333.A657@yukari.lineo.com>; from beppu@lineo.com on Sat, Jul 29, 2000 at 11:03:33 -0600
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...
> <question type="stupid">
> What does the keyword "in" mean?
> </question>
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
next prev parent reply other threads:[~2000-08-02 11:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-26 17:51 John BEPPU
2000-07-27 18:47 ` Alain Frisch
2000-07-27 18:56 ` Markus Mottl
2000-07-29 17:03 ` John BEPPU
2000-07-29 17:23 ` Markus Mottl [this message]
2000-07-31 7:11 ` Vitaly Lugovsky
2000-07-31 8:43 ` Markus Mottl
2000-08-02 16:58 ` Printable Caml manual Walid Taha
2000-07-27 18:57 ` help an o'caml beginner Remi VANICAT
2000-07-27 19:08 ` Jean-Christophe Filliatre
2000-07-27 21:31 ` Laurent Chéno
2000-07-27 23:47 ` Michel Quercia
2000-07-27 18:24 Brent Fulgham
2000-07-27 18:43 Lenny Gray
2000-07-27 22:50 John R Harrison
2000-07-28 12:49 ` John BEPPU
2000-08-02 17:28 Brent Fulgham
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=20000729192334.A26830@miss.wu-wien.ac.at \
--to=mottl@miss.wu-wien.ac.at \
--cc=beppu@lineo.com \
--cc=caml-list@inria.fr \
/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