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 MAA29223; Fri, 11 Oct 2002 12:22:59 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA29170 for ; Fri, 11 Oct 2002 12:22:58 +0200 (MET DST) Received: from anumail2.anu.edu.au (anumail2.anu.edu.au [150.203.2.42]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9BAMuD24768 for ; Fri, 11 Oct 2002 12:22:56 +0200 (MET DST) Received: from zed.cipputi.it (rsisedhcp-166.anu.edu.au [150.203.126.166]) by anumail2.anu.edu.au (8.12.4/8.12.4) with ESMTP id g9BAMqi6009689 for ; Fri, 11 Oct 2002 20:22:52 +1000 (EST) Received: from zed.cipputi.it (zed [127.0.0.1]) by zed.cipputi.it (8.12.6/8.12.6/Debian-6) with ESMTP id g9BAJXbx014726 for ; Fri, 11 Oct 2002 20:19:33 +1000 Received: (from abate@localhost) by zed.cipputi.it (8.12.6/8.12.6/Debian-6) id g9BAJX1o014724 for caml-list@inria.fr; Fri, 11 Oct 2002 20:19:33 +1000 Date: Fri, 11 Oct 2002 20:19:33 +1000 From: Pietro Abate To: caml-list@inria.fr Subject: Re: [Caml-list] self and mutually recursive functions ? Message-ID: <20021011101933.GA14232@zed> Mail-Followup-To: Pietro Abate , caml-list@inria.fr References: <20021010154738.GA12586@rhinoceros.mts> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021010154738.GA12586@rhinoceros.mts> User-Agent: Mutt/1.4i X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Austrialian National University) X-Spam-Status: Scanned X-Spam-Score: (-3.5) X-Spam-Tests: IN_REP_TO,SUBJ_ENDS_IN_Q_MARK X-Scanned-By: MIMEDefang 2.15 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Oct 10, 2002 at 05:47:38PM +0200, Metalscan wrote: > In each of them, there would be a match with one > branch returning itself and the other one returning > the other function. do you want something like that ? let rec f1 i = match i with | 1 -> f1 (i-1) | 2 -> f2 (i-1) | a -> let _ = Printf.printf "f1 = %d\n" a in a and f2 j = match j with | 1 -> f2 (j-1) | 2 -> f1 (j-1) | a -> let _ = Printf.printf "f2 = %d\n" a in a ;; # f1 1;; f1 = 0 - : int = 0 # f1 2;; f2 = 0 - : int = 0 regards, p -- pgp key: 1024D/8A091922 2000-10-18 Pietro Abate Key fingerprint = 5111 D91B 5E0C 5CE6 FDA3 5EF4 6120 E18E 8A09 1922 public key avalaible via public key server at wwwkeys.eu.pgp.net ------------------- 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