From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA02302; Fri, 8 Aug 2003 00:26:58 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA08880 for ; Fri, 8 Aug 2003 00:26:57 +0200 (MET DST) Received: from mail2.tpgi.com.au (mail.tpgi.com.au [203.12.160.58]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h77MQtT07791 for ; Fri, 8 Aug 2003 00:26:56 +0200 (MET DST) Received: from ozemail.com.au (203-213-127-88-syd-ts20-2600.tpgi.com.au [203.213.127.88]) (authenticated bits=0) by mail2.tpgi.com.au (8.12.9/8.12.9) with ESMTP id h77MQOXi004031; Fri, 8 Aug 2003 08:26:25 +1000 Message-ID: <3F32D210.6060302@ozemail.com.au> Date: Fri, 08 Aug 2003 08:26:24 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Yaron Minsky CC: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Multi-keyed lookup table? References: <20030807194135.GB21983@swordfish> <38641.141.155.88.179.1060292970.squirrel@minsky-primus.homeip.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Kaspersky-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ozemail:01 caml-list:01 yaron:01 minsky:01 simplistic:01 hashtable:01 hash:01 hashtables:01 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 nsw:01 snail:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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