Version française
Home     About     Download     Resources     Contact us    
Browse thread
Representation of different polymorphic variants guaranteed to be different?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Elnatan Reisner <elnatan@c...>
Subject: Re: [Caml-list] Representation of different polymorphic variants guaranteed to be different?
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