[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | John Max Skaller <skaller@o...> |
| Subject: | Re: [Caml-list] Multi-keyed lookup table? |
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. That's actually a fairly neat trick to embody multiple index tables in one data structure. The main problem is probably that hashtables aren't ordered, so there is no way of getting all the values of a particular 'index' quickly. A Map does not have this problem .. but then it doesn't hash .. where's that cake I've just eaten .. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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