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 QAA12883; Thu, 8 Jan 2004 16:48:02 +0100 (MET) 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 QAA12151 for ; Thu, 8 Jan 2004 16:48:01 +0100 (MET) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i08Fm0522507 for ; Thu, 8 Jan 2004 16:48:00 +0100 (MET) Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1AecO7-0005nj-00 for ; Thu, 08 Jan 2004 15:47:59 +0000 Date: Thu, 8 Jan 2004 15:47:59 +0000 To: caml-list@inria.fr Subject: Re: [Caml-list] Reason why 'for' doesn't work across floats? Message-ID: <20040108154759.GA22093@redhat.com> References: <20040108141152.GA19714@redhat.com> <20040108150358.GA6893@roke.freak> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040108150358.GA6893@roke.freak> User-Agent: Mutt/1.5.4i From: Richard Jones X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 floats:01 2004:99 michal:01 moskal:01 2004:99 floats:01 printf:01 freshmeat:01 ltd:98 ocaml:01 int:01 int:01 float:02 float:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Jan 08, 2004 at 04:03:58PM +0100, Michal Moskal wrote: > On Thu, Jan 08, 2004 at 02:11:52PM +0000, Richard Jones wrote: > > Is there a particular reason why I shouldn't be allowed to step over > > floats? > > > > # for r = 0. to 9. step 1. do printf "%f" r done;; > > -- > > This expression has type float but is here used with type int > > let f a b = for x = a to b do () done > > What type would f have (int -> int -> int or float -> float -> float)? > One would need "for.", which doesn't seem appealing. Perhaps 'a -> 'a -> 'a ? Is this much different from the generic-but-not-really < operator in OCaml? Rich. -- Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj Merjis Ltd. http://www.merjis.com/ - improving website return on investment http://www.YouUnlimited.co.uk/ - management courses ------------------- 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