From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 24C20BC2F for ; Fri, 26 Nov 2004 20:36:50 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAQJanxv032115 for ; Fri, 26 Nov 2004 20:36:49 +0100 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 UAA19542 for ; Fri, 26 Nov 2004 20:36:49 +0100 (MET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.205]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAQJamkT024534 for ; Fri, 26 Nov 2004 20:36:48 +0100 Received: by rproxy.gmail.com with SMTP id a36so270138rnf for ; Fri, 26 Nov 2004 11:36:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=qF3AHgBVF6Dtjeu1aw8vD8JvYnWJqWKWfyuGaYpsYQuJu+45eY1Z6WYkz/ygRsKX0Rlz/8bFp+KcoW7PbLyWnwa6RChsH5v037fBV5aAlUJ44DTFAyq4n8p9sHgcDVjAO/ftPypDF9MS0JsbWo808qMxdZJSWFpPPIlUjhb9z4o= Received: by 10.38.171.14 with SMTP id t14mr618036rne; Fri, 26 Nov 2004 11:36:47 -0800 (PST) Received: by 10.38.82.20 with HTTP; Fri, 26 Nov 2004 11:36:47 -0800 (PST) Message-ID: Date: Fri, 26 Nov 2004 20:36:47 +0100 From: Michal Moskal Reply-To: Michal Moskal To: Nicolas Cannasse Subject: Re: [Caml-list] Why doesn't ocamlopt detect a missing ; after failwith statement? Cc: skaller@users.sourceforge.net, Jacques Garrigue , caml-list@inria.fr In-Reply-To: <004201c4d386$cc6fe4a0$19b0e152@warp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable References: <1101427906.9291.107.camel@pelican.wigram> <20041126.094412.30442729.garrigue@math.nagoya-u.ac.jp> <1101438486.9291.138.camel@pelican.wigram> <20041126.142525.93385094.garrigue@math.nagoya-u.ac.jp> <004201c4d386$cc6fe4a0$19b0e152@warp> X-Miltered: at concorde with ID 41A785D1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41A785D0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; michal:01 moskal:01 michal:01 moskal:01 caml-list:01 ocamlopt:01 failwith:01 cannasse:01 warplayer:01 wrote:01 failwith:01 forall:01 arity:01 syntax:01 malekith:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: On Fri, 26 Nov 2004 08:08:57 +0100, Nicolas Cannasse wr= ote: > > P.S. > > I believe the problem with failwith is solvable, albeit rather > > complicated. The idea is that you want to be warned when you apply a > > function of type (\forall 'a. 'a) to something, because no such > > function may exist, so that this application will never actually take > > place. > > > > This could be done attempting to generalize the type of the function, > > once we now it is a type variable. > > I'll have a try. >=20 > Wouldn't that break Obj.magic ? I can't see a clear solution to this > problem, unless enabling arity specification into polymorphic variables : > 'a.0 for example, but this would also break something like : >=20 > let f x =3D if x then failwith "error" else fun() -> x No, because here you're applying functional type that got unified with the variable, and not the ununified type variable itself. > I guess it's more like a syntax problem. For example having parenthesis f= or > function calls =E0 la C would disable any ambiguity. And this is why an empty word as an function application is wrong :-) --=20 : Michal Moskal ::: http://nemerle.org/~malekith/ :: GCS !tv h e>+++ b++ : ::: Logic is a nice contrast to the Real World. :: UL++++$ C++ E--- a?