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 NAA28937; Mon, 11 Aug 2003 13:48:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA00908 for ; Mon, 11 Aug 2003 13:48:44 +0200 (MET DST) Received: from mwinf0101.wanadoo.fr (smtp8.wanadoo.fr [193.252.22.30]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h7BBmif15401 for ; Mon, 11 Aug 2003 13:48:44 +0200 (MET DST) Received: from debian (ca-bordeaux-9-87.w80-8.abo.wanadoo.fr [80.8.81.87]) by mwinf0101.wanadoo.fr (SMTP Server) with ESMTP id F3D83C000087 for ; Mon, 11 Aug 2003 13:48:43 +0200 (CEST) Received: from moi by debian with local (Exim 3.36 #1 (Debian)) id 19mBD7-000125-00 for ; Mon, 11 Aug 2003 13:51:37 +0200 To: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Multi-keyed lookup table? References: <3F32D078.7060705@ozemail.com.au> <20030807194135.GB21983@swordfish> <38641.141.155.88.179.1060292970.squirrel@minsky-primus.homeip.net> <3F32D210.6060302@ozemail.com.au> <20030807194135.GB21983@swordfish> <38641.141.155.88.179.1060292970.squirrel@minsky-primus.homeip.net> <20030807194135.GB21983@swordfish> <20030808213037.GA21525@swordfish> From: Remi Vanicat Mail-Copy-To: never Date: Mon, 11 Aug 2003 13:51:36 +0200 In-Reply-To: <20030808213037.GA21525@swordfish> (Matt Gushee's message of "Fri, 8 Aug 2003 15:30:37 -0600") Message-ID: <87adagmmyf.dlv@wanadoo.fr> User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 gushee:01 0400,:01 yaron:01 minsky:01 simplistic:01 hashtable:01 hash:01 font:99 dept-info:01 labri:01 u-bordeaux:01 writes:01 remi:01 vanicat:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 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