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 HAA07627; Mon, 3 Sep 2001 07:26:27 +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 HAA07628 for ; Mon, 3 Sep 2001 07:26:27 +0200 (MET DST) Received: from smtp.nwlink.com (smtp.nwlink.com [209.20.130.57]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f835QP129397 for ; Mon, 3 Sep 2001 07:26:26 +0200 (MET DST) Received: from ip178.usw22.rb1.bel.nwlink.com (ip178.usw22.rb1.bel.nwlink.com [207.202.195.178]) by smtp.nwlink.com (8.9.3/8.9.1) with SMTP id WAA17187 for ; Sun, 2 Sep 2001 22:24:29 -0700 (PDT) Received: (qmail 22562 invoked by uid 500); 3 Sep 2001 05:25:55 -0000 Date: Sun, 2 Sep 2001 22:25:55 -0700 From: Michael Leary To: caml Subject: [Caml-list] function type confusion (using let) Message-ID: <20010902222555.A22545@ip178.usw22.rb1.bel.nwlink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 if x < -.pi then (* <------ here *) pi2 +. x else x File "fbot.ml", line 118, characters 4-52: This expression has type float but is here used with type unit I want normr to be float -> 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