From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA04817; Mon, 27 Oct 2003 02:42:24 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 CAA02320 for ; Mon, 27 Oct 2003 02:42:23 +0100 (MET) Received: from front3.mail.megapathdsl.net (front3.mail.megapathdsl.net [66.80.60.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h9R1gM112234 for ; Mon, 27 Oct 2003 02:42:22 +0100 (MET) Received: from [82.41.207.31] (account bkavanagh@megapathdsl.net HELO Archimedes) by front3.mail.megapathdsl.net (CommuniGate Pro SMTP 4.1.3) with ESMTP id 105659101 for caml-list@inria.fr; Sun, 26 Oct 2003 17:42:13 -0800 From: "Ben Kavanagh" To: Subject: [Caml-list] partial eval question Date: Mon, 27 Oct 2003 01:41:49 -0000 Message-ID: <004a01c39c2b$819db8f0$1fcf2952@Archimedes> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Loop: caml-list@inria.fr X-Spam: no; 0.00; closures:01 caml:01 rec:01 partial:03 partial:03 iter:03 iter:03 let:04 let:04 mod:07 defined:07 pow:08 pow:08 function:09 perform:10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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