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
Case-insensitive lexing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-02-24 (00:38)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Case-insensitive lexing
On Friday 23 February 2007 23:39, you wrote:
> Because, at least what I think, comparing strings using a hash-table is way
> faster than comparing them using pattern-matching.

I had always assumed that OCaml would build an optimal dispatch table when 
pattern matching over strings but it seems you are quite right: it does the 
worst possible linear string equality tests, not even O(log n) comparisons.

That seems like a great shame to me. Can someone implement this?

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