English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Maximum non-constant constructors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-03-17 (17:54)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Maximum non-constant constructors
On Thursday 17 March 2005 14:00, Eric Cooper wrote:
> For example, for all strings XXX, the variants `XXX and `zyctRecXXX
> collide.

So they do:

# type a = [ `ABC | `zyctRecABC ];;
Variant tags `ABC and `zyctRecABC have same hash value. Change one of them.

> My guess is that none of them are likely to be chosen by
> humans, but might occur in program-generated code.

Good point! I think this justifies the existence of a library function to 
compare the hashes of string names of polymorphic variants. Does such a 
function exist?

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists