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,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 51B98BBAF for ; Wed, 8 Jul 2009 21:32:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEyRVEqACH+TmWdsb2JhbACZEAEBAQEBCAsKBxOnCIg9iEyECAU X-IronPort-AV: E=Sophos;i="4.42,370,1243807200"; d="scan'208";a="32712187" Received: from server-nat-4.cs.umd.edu (HELO bacon.cs.umd.edu) ([128.8.127.147]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Jul 2009 21:32:03 +0200 X-CSD-MailScanner-Watermark: 1247686321.88042@64YSW/LZ0UPJBdZ4Sa3Xkg Received: from veruca.cs.umd.edu (veruca.cs.umd.edu [128.8.128.211]) (authenticated bits=0) by bacon.cs.umd.edu (8.13.1/8.14.1) with ESMTP id n68JW0le022974 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 8 Jul 2009 15:32:01 -0400 Subject: Re: [Caml-list] Representation of different polymorphic variants guaranteed to be different? From: Elnatan Reisner To: caml-list@yquem.inria.fr In-Reply-To: <20090708185415.GB11681@localhost> References: <20090708183527.GC3432@colinux> <20090708185415.GB11681@localhost> Content-Type: text/plain Date: Wed, 08 Jul 2009 15:32:00 -0400 Message-Id: <1247081520.5510.31.camel@veruca.cs.umd.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-41.el4_7.2) Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (bacon.cs.umd.edu [172.24.3.34]); Wed, 08 Jul 2009 15:32:01 -0400 (EDT) X-Spam: no; 0.00; variants:01 0200,:01 variants:01 translated:01 compile-time:01 2009:98 2009:98 870:98 polymorphic:01 polymorphic:01 wrote:01 wrote:01 caml-list:01 caml-list:01 short:01 On Wed, 2009-07-08 at 14:54 -0400, Eric Cooper wrote: > On Wed, Jul 08, 2009 at 08:35:27PM +0200, Bruno Daniel wrote: > > How is it ensured that I get a <> b for a and b created as > > polymorphic variants from two different identifiers? Will pattern > > matching give wrong results if I accidentally choose two different > > identifiers translated to the same internal representation? > > See this thread: > http://caml.inria.fr/pub/ml-archives/caml-list/2005/03/544288096a47d82ec870d01c8396f5fe.fr.html > > Short answer: collisions could theoretically occur, but are detected > at link time. That thread actually concludes that the check is at compile-time: http://caml.inria.fr/pub/ml-archives/caml- list/2005/03/7965b012288982e74718b2ae769dc189.fr.html