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
[Caml-list] Multi-keyed lookup table?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-08-11 (11:48)
From: Remi Vanicat <vanicat@l...>
Subject: Re: [Caml-list] Multi-keyed lookup table?
Matt Gushee <> writes:

> On Thu, Aug 07, 2003 at 05:49:30PM -0400, Yaron Minsky wrote:
>> This might be too simplistic, but how about creating a union type the
>> includes all of the different things you might want to index on, and then
>> use that as the key to a hashtable.  The efficiency of that would hinge on
>> the efficiency of the hash function, I would think.   I would expect it to
>> be simple to implement and pretty quick.
> You mean something like:
>   type font_spec = (font_family * font_weight * font_style * font_width
>                     * encoding)

I believe he mean :

type font_spec = 
     | Font_family of font_family
     | Font_weight of font_weight 
     | Font_style  of font_style
     | Font_width  of font_width
     | Encodinf    of encoding

then each font is put into the hashtable several time (one for each 

Rémi Vanicat

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: