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 LAA12244; Mon, 3 Sep 2001 11:34:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA12588 for caml-list@pauillac.inria.fr; Mon, 3 Sep 2001 11:34:16 +0200 (MET DST) 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 IAA08781 for ; Mon, 3 Sep 2001 08:28:16 +0200 (MET DST) Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f836SFr06406 for ; Mon, 3 Sep 2001 08:28:15 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.7.6/8.7.3) with ESMTP id IAA22021 for ; Mon, 3 Sep 2001 08:28:15 +0200 (MET DST) Received: from p-mail1.cnet.fr (p-mail1.rd.francetelecom.com [193.49.124.31]) by concorde.inria.fr (8.11.1/8.10.0) with SMTP id f836SFr06402 for ; Mon, 3 Sep 2001 08:28:15 +0200 (MET DST) Received: by p-biset.rd.francetelecom.fr with Internet Mail Service (5.5.2653.19) id ; Mon, 3 Sep 2001 08:27:46 +0200 Message-ID: From: FALCON Gilles FTRD/DTL/LAN To: =?ISO-8859-1?Q?=27Laurent_Ch=E9no=27?= , Michael Leary Cc: Caml-list Subject: RE: [Caml-list] function type confusion (using let) Date: Mon, 3 Sep 2001 08:26:52 +0200 Importance: low X-Priority: 5 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk -----Message d'origine----- De : Laurent Ch=E9no [mailto:laurent.cheno@noos.fr] Envoy=E9 : lundi 3 septembre 2001 07:55 =C0 : Michael Leary Cc : Caml-list Objet : Re: [Caml-list] function type confusion (using let) (* please excuse my poor english *) > I was trying to be clever about not using ;; and minimizing my use of = ;=20 > in > files, and I've gone off the deep end... > > Why is this wrong, and how do I fix it?: > > let pi =3D 3.14159 > let pi2 =3D 2.0 *. pi > > let normr r =3D > let x =3D mod_float r pi2 in > if x > 0.0 then > if x > pi then > -.pi2 +. x > else > x > else if x < 0.0 then ^ this "then" has no else ! > if x < -.pi then (* <------ here *) > pi2 +. x > else > x ... else ?? You have forgotten the "else" clause : if then has=20 type : unit if then else has type : float ------------------- 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 ------------------- 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