From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2DF4FBC69 for ; Tue, 31 Jul 2007 17:27:44 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6VFRhEo032227 for ; Tue, 31 Jul 2007 17:27:43 +0200 Received: by nz-out-0506.google.com with SMTP id x7so1022999nzc for ; Tue, 31 Jul 2007 08:27:43 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HLszXOygh0dAjd+uAAzFgz4I6n4+C4NKSHIcbhebfLUsiSUPD0dkGAeCFnUzFL5esWVUHtw1/xIy0Lg1ad1ozrQyzTGIXIGhsJGbUdeG5SGwP7ARjaziV3Kba8l5Qb9Ds15KPC/vUV4L6ujf3rx6LSeC866Ps1opEU+m8/DL6e0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cuhjeuClA+sumc0S4Qaq0XC+faR4Vff415lw+Og30wJ3QVeosvyV4t9zXBtYQnP3Ci6kO0FGrkRgF/tPKA+pVW/h9EDc6/uR9n4drSboKGmSVDTWbLEhVeV1hEeIAFyolUUqkeMrPgM0GDV4smO5pEZqjvvK3PTq76a5E3z+u0U= Received: by 10.142.100.1 with SMTP id x1mr353903wfb.1185895662557; Tue, 31 Jul 2007 08:27:42 -0700 (PDT) Received: by 10.142.255.12 with HTTP; Tue, 31 Jul 2007 08:27:42 -0700 (PDT) Message-ID: Date: Tue, 31 Jul 2007 11:27:42 -0400 From: "Markus Mottl" To: "Chris King" Subject: Re: [Caml-list] Re: Void type? Cc: "Richard Jones" , "Brian Hurt" , caml-list@yquem.inria.fr In-Reply-To: <875c7e070707310608u760a6ea4mfe5c241019353d29@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46AC7BB8.8050609@gmail.com> <20070729124340.GA18564@furbychan.cocan.org> <46AC8EEF.1040102@gmail.com> <20070729170216.GA8137@furbychan.cocan.org> <46ACF35F.5070102@lix.polytechnique.fr> <1185770437.11618.29.camel@rosella.wigram> <20070731085239.GA3217@furbychan.cocan.org> <875c7e070707310608u760a6ea4mfe5c241019353d29@mail.gmail.com> X-j-chkmail-Score: MSGID : 46AF54EF.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46AF54EF.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; markus:01 mottl:01 markus:01 mottl:01 compiler:01 uncaught:01 ocaml:01 wrote:01 assert:01 caml-list:01 exceptions:01 variant:02 essentially:02 match:02 black:96 On 7/31/07, Chris King wrote: > Personally I would use the second. That way, when you come across a > void value (say, in pattern matching a variant), you can take care of > that match case without resorting to "assert false" (whether directly > or via void_elim): This is the exact reason why I used this solution: the compiler essentially proves to you that this branch will never be taken, because it is impossible to create a value that is a member of any type (without black magic, that is). This is important if you want to check your code for uncaught exceptions, especially if you eventually want to do this mechanically. Regards, Markus -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com