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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 9C79FBC6C for ; Fri, 8 Feb 2008 21:01:03 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAI9DrEfUnw6EhWdsb2JhbACCN41+AQEBCAIIBwgTB5wN X-IronPort-AV: E=Sophos;i="4.25,322,1199660400"; d="scan'208";a="8974239" Received: from pih-relay05.plus.net ([212.159.14.132]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Feb 2008 21:01:03 +0100 Received: from [80.229.56.224] (helo=beast.local) by pih-relay05.plus.net with esmtp (Exim) id 1JNZPA-00006v-GA for caml-list@yquem.inria.fr; Fri, 08 Feb 2008 20:01:00 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2 Date: Fri, 8 Feb 2008 19:07:58 +0000 User-Agent: KMail/1.9.7 References: <1202396482.6084.5.camel@Blefuscu> <20080208.001729.233402575.garrigue@math.nagoya-u.ac.jp> <20080208095333.GA582@snarc.org> In-Reply-To: <20080208095333.GA582@snarc.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802081907.58290.jon@ffconsultancy.com> X-Plusnet-Relay: e5d48a394c861de1379c8c36a4a4b274 X-Spam: no; 0.00; polymorphics:01 variants:01 constructors:01 foo:01 frog:98 polymorphic:01 polymorphic:01 wrote:01 caml-list:01 strings:01 strings:01 variant:02 variant:02 define:02 define:02 On Friday 08 February 2008 09:53:33 Vincent Hanquez wrote: > so what's the point in using polymorphics variant then ? Brevity: | Xml.Error.Succeed x -> f x | Xml.Error.Failure y -> g y vs: | `Succeed x -> f x | `Failure y -> g y The alternative is to open the namespace that contains the ordinary variant, which pollutes your namespace will all of its identifiers. > > And they _cannot_ pollute any namespace, since they define nothing. > > did you actually read my previous reply ? > they "pollute" since the polymorphic variant namespace is flat, and > don't interact with module (on purpose obviously) As Jacques said, polymorphic variants don't define anything, i.e. don't bind identifiers to type constructors. So they can't pollute anything. The "flat namespace" you refer to doesn't exist. This is the same as strings. You would not discourage the use of "foo" in programs because it "pollutes the flat namespace of strings" for the same reason. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e