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 696DCBC2F for ; Fri, 26 Nov 2004 08:05:43 +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 iAQ75gq1030363 for ; Fri, 26 Nov 2004 08:05:42 +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 IAA21692 for ; Fri, 26 Nov 2004 08:05:41 +0100 (MET) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAQ75eKp025931 for ; Fri, 26 Nov 2004 08:05:40 +0100 Received: from warp (chateaudeau-4-82-225-176-25.fbx.proxad.net [82.225.176.25]) by postfix4-2.free.fr (Postfix) with SMTP id 384B8235761; Fri, 26 Nov 2004 08:05:40 +0100 (CET) Message-ID: <004201c4d386$cc6fe4a0$19b0e152@warp> From: "Nicolas Cannasse" To: , "Jacques Garrigue" Cc: 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> Subject: Re: [Caml-list] Why doesn't ocamlopt detect a missing ; after failwith statement? Date: Fri, 26 Nov 2004 08:08:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Miltered: at concorde with ID 41A6D5C6.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41A6D5C4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 ocamlopt:01 failwith:01 failwith:01 forall:01 arity:01 syntax:01 polymorphic:01 nicolas:02 nicolas:02 guess:02 variables:02 parenthesis:03 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=none autolearn=disabled version=3.0.0 X-Spam-Level: > 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. 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 : let f x = if x then failwith "error" else fun() -> x I guess it's more like a syntax problem. For example having parenthesis for function calls à la C would disable any ambiguity. Nicolas