caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] partial eval question
@ 2003-10-27  1:41 Ben Kavanagh
  2003-10-27  7:14 ` Damien
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Ben Kavanagh @ 2003-10-27  1:41 UTC (permalink / raw)
  To: caml-list


Say I have a function such as pow defined as

let pow n x = 
    let rec pow_iter (n1, x1, p1) = 
        if (n1 = 0) then p1 
        else if (n1 mod 2 = 0) 
		 then pow_iter(n1/2, x1*x1, p1) 
             else pow_iter(n1-1, x1, p1*x1)
    in pow_iter(n, x, 1);;

and I say 

let pow2 = pow 2

Are there any ML implementations that would automatically perform
partial evaluation to create pow2 instead of using closures, possibly
unfolding the pow_iter call? Would Caml ever have this capability?

Ben


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2004-02-05 21:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-27  1:41 [Caml-list] partial eval question Ben Kavanagh
2003-10-27  7:14 ` Damien
2003-10-27 15:39   ` William Chesters
2003-10-27 18:50     ` Andrew Lenharth
2003-10-27 19:12       ` William Chesters
2003-10-27 20:08         ` Jacques Carette
2004-02-04  3:03           ` Walid Taha
2003-10-27 22:11         ` Andrew Lenharth
2004-02-04  2:59       ` Walid Taha
2004-02-04  5:53         ` Andrew Lenharth
2004-02-05 21:29           ` Walid Taha
2003-10-27 19:17     ` Yann Regis-Gianas
2003-10-28 10:46       ` William Chesters
2004-02-04  2:22         ` Walid Taha
2004-02-04  2:56     ` Walid Taha
2003-10-28 15:09   ` Dmitry Lomov
2003-10-27 15:16 ` Vincent Balat [prof Moggi team]
2004-02-04  2:51 ` Walid Taha
2004-02-04 10:26   ` Ben Kavanagh
2004-02-04 10:32   ` Ben Kavanagh
2004-02-05 21:11     ` Walid Taha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).