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 VAA12743; Thu, 21 Oct 2004 21:42:29 +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 VAA02794 for ; Thu, 21 Oct 2004 21:42:28 +0200 (MET DST) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9LJgRZU023346 for ; Thu, 21 Oct 2004 21:42:27 +0200 Received: from [192.168.1.101] (KMMCDXI.dsl.saunalahti.fi [195.197.18.211]) by will.iki.fi (Postfix) with ESMTP id 62004AD; Thu, 21 Oct 2004 22:42:27 +0300 (EEST) Message-ID: <4178111C.7020407@exomi.com> Date: Thu, 21 Oct 2004 22:42:20 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 0.8 (X11/20041016) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jon Harrop Cc: caml-list Subject: Re: [Caml-list] Polymorphism and the "for" loop References: <200410211950.43396.jon@jdh30.plus.com> <41780A38.4030505@exomi.com> <200410212020.54333.jon@jdh30.plus.com> In-Reply-To: <200410212020.54333.jon@jdh30.plus.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41781123.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 silently:01 lacks:01 gcc:01 compilers:01 ocaml:01 logical:02 unit:03 wrote:03 propagate:04 compiled:05 seems:05 probably:05 variables:06 polymorphism:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jon Harrop wrote: >I see. Does this stem from historical reasons or is there a logical reason why >this should be a warning rather than an error? > > Good question. Personally, I probably would've made it an error. >Yes, whereas the current approach can "fail" silently: > ># f (fun () -> 1);; >- : unit = () > > That's not a failure, just a lack of a warning, since the type system lacks the ability to propagate the "" property that I suggested. Compared to compilers for other languages, OCaml seems to me fairly easy to understand in its warnings/lack-thereof. I've run into quite a bit of C++ code, compiled using GCC, that generates (unjustified) warnings about potentially uninitialized variables on some architectures (PA-RISC/HP-UX) but not others... ------------------- 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