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 WAA04516; Mon, 25 Jun 2001 22:31:16 +0200 (MET DST) 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 WAA04470 for ; Mon, 25 Jun 2001 22:31:15 +0200 (MET DST) Received: from bassia.wanadoo.fr (smtp-rt-5.wanadoo.fr [193.252.19.159]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f5PKVEL06315 for ; Mon, 25 Jun 2001 22:31:15 +0200 (MET DST) Received: from mahonia.wanadoo.fr (193.252.19.58) by bassia.wanadoo.fr; 25 Jun 2001 22:31:14 +0200 Received: from debian (213.56.53.145) by mahonia.wanadoo.fr; 25 Jun 2001 22:30:57 +0200 Received: from moi by debian with local (Exim 3.22 #1 (Debian)) id 15Ecvq-0000Ty-00 for ; Mon, 25 Jun 2001 22:26:02 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Newbie question about type (and syntax?) References: <8766dk72yw.fsf@adept.co.za> From: Remi VANICAT Date: 25 Jun 2001 22:26:02 +0200 In-Reply-To: <8766dk72yw.fsf@adept.co.za> Message-ID: <871yo89uhx.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.103 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Johann Spies writes: > I am working through a tutorial and typing in the following example > produced an error: > > ------------------------------- > let rec power i x = > if i = 0 then > 1 > else > x *. (power (i-1) x);; > This expression has type float but is here used with type int > ------------------------------------------------------- > > I can not see why it is an error and how to correct the code coming > from the tutorial. 1 is an int. it's the problem, you should use 1. (after the then) -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr