Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Remi Vanicat <vanicat@l...>
Subject: Re: [Caml-list] Multi-keyed lookup table?
Matt Gushee <matt@gushee.net> 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 
characteristic)

-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners