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 HAA08183; Mon, 3 Sep 2001 07:55:26 +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 HAA07983 for ; Mon, 3 Sep 2001 07:55:25 +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 f835tPr05671 for ; Mon, 3 Sep 2001 07:55:25 +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 HAA22017 for ; Mon, 3 Sep 2001 07:55:25 +0200 (MET DST) Received: from smtp.noos.fr (claudel.noos.net [212.198.2.83]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f835tOr05667 for ; Mon, 3 Sep 2001 07:55:24 +0200 (MET DST) Message-Id: <200109030555.f835tOr05667@concorde.inria.fr> Received: (qmail 32953130 invoked by uid 0); 3 Sep 2001 05:55:24 -0000 Received: from unknown (HELO localhost) ([212.198.203.74]) (envelope-sender ) by 212.198.2.83 (qmail-ldap-1.03) with SMTP for ; 3 Sep 2001 05:55:24 -0000 Date: Mon, 3 Sep 2001 07:55:23 +0200 From: =?iso-8859-1?Q?Laurent_Ch=E9no?= Content-Type: text/plain; format=flowed; charset=us-ascii Subject: Re: [Caml-list] function type confusion (using let) Cc: Caml-list To: Michael Leary X-Mailer: Apple Mail (2.388) In-Reply-To: <20010902222555.A22545@ip178.usw22.rb1.bel.nwlink.com> Mime-Version: 1.0 (Apple Message framework v388) Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk (* please excuse my poor english *) > I was trying to be clever about not using ;; and minimizing my use of ; > in > files, and I've gone off the deep end... > > Why is this wrong, and how do I fix it?: > > let pi = 3.14159 > let pi2 = 2.0 *. pi > > let normr r = > let x = 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 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