Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Hash clash in polymorphic variants
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Hash clash in polymorphic variants
On Thursday 10 January 2008 20:35:34 Eric Cooper wrote:
> On Thu, Jan 10, 2008 at 05:09:13PM +0000, Jon Harrop wrote:
> > ISTR advice that constructors sharing the first few characters should be
> > avoided in order to reduce the likelihood of clashing hash values for
> > polymorphic variants. Is that right?
> I don't think it's worth worrying about.
> I wrote a program a while ago to look into this.  I never saw any
> "human-sensible" collisions (between two identifiers that a person
> might have chosen). And if you're producing gensyms in a program, you
> can just check ahead of time.

I'm interested in automatically translating the GL_* enum from OpenGL into 
polymorphic variants. So although it is generated code I have little control 
over it, e.g. I cannot change the translation as OpenGL gets extended because 
code will already be using the existing names.

Still, maybe I'm over-reacting. ;-)

Dr Jon D Harrop, Flying Frog Consultancy Ltd.