From: Peng Zang <peng.zang@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Help with simple ocaml memoization problem
Date: Thu, 29 Nov 2007 10:59:42 -0500 [thread overview]
Message-ID: <200711291059.45441.peng.zang@gmail.com> (raw)
In-Reply-To: <200711290808.46180.jon@ffconsultancy.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ahhh.. that is helpful. Thanks Jon,
Peng
On Thursday 29 November 2007 03:08:45 am Jon Harrop wrote:
> On Thursday 29 November 2007 05:53, Peng Zang wrote:
> > I don't know how to increase the stack size off the top of my head, but
> > in general you want to avoid recursion on the stack anyways. An easy way
> > is to simply make the function tail recursive so the compiler can
> > optimized it into a loop for you. Here's a pretty faithful replication
> > of your python code. Note I use Int64 instead of BigInt as I'm running
> > OCaml 3.09.3. ...
> > let l1 = Int64.of_int 1;;
> > let l2 = Int64.of_int 2;;
> > let l3 = Int64.of_int 3;;
>
> OCaml has int64 literals built-in:
>
> # 3L;;
> - : int64 = 3L
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFHTuHxfIRcEFL/JewRAhmoAKDCBN9QvQD5kxQATcOG9Ekj3YDkNQCeLiNl
1aGy4MJSYcMZfpcZY/D2chE=
=WzAJ
-----END PGP SIGNATURE-----
prev parent reply other threads:[~2007-11-29 15:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 3:17 Evan Klitzke
2007-11-29 5:53 ` [Caml-list] " Peng Zang
2007-11-29 6:12 ` Evan Klitzke
2007-11-29 8:16 ` David Allsopp
2007-11-29 8:11 ` Jon Harrop
2007-11-29 8:58 ` Jean-Christophe Filliâtre
2007-11-29 18:57 ` Jon Harrop
2007-11-29 22:25 ` Jon Harrop
2007-11-30 11:03 ` Jean-Christophe Filliâtre
2007-11-29 8:40 ` Luc Maranget
2007-11-29 8:47 ` Jean-Christophe Filliâtre
2007-12-04 23:49 ` Peng Zang
2007-11-29 8:08 ` Jon Harrop
2007-11-29 15:59 ` Peng Zang [this message]
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=200711291059.45441.peng.zang@gmail.com \
--to=peng.zang@gmail.com \
--cc=caml-list@yquem.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