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 AAA02493; Sat, 9 Aug 2003 00:13:22 +0200 (MET DST) 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 AAA20927 for ; Sat, 9 Aug 2003 00:13:21 +0200 (MET DST) Received: from epexch01.qlogic.org ([63.170.40.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h78MDKf22055 for ; Sat, 9 Aug 2003 00:13:20 +0200 (MET DST) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Fri, 8 Aug 2003 17:13:28 -0500 Received: from eagle.ancor.com ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Fri, 8 Aug 2003 17:13:19 -0500 Received: from localhost (bhurt@localhost) by eagle.ancor.com (8.11.6/8.11.6) with ESMTP id h78MDJa01743; Fri, 8 Aug 2003 17:13:19 -0500 X-Authentication-Warning: eagle.ancor.com: bhurt owned process doing -bs Date: Fri, 8 Aug 2003 17:13:18 -0500 (CDT) From: Brian Hurt X-X-Sender: To: Matt Gushee cc: Subject: Re: [Caml-list] Multi-keyed lookup table? In-Reply-To: <20030808213037.GA21525@swordfish> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 08 Aug 2003 22:13:19.0795 (UTC) FILETIME=[463A7830:01C35DFA] X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 gushee:01 font:99 fallback:01 preferable:01 match:02 tree:02 coding:03 wrote:03 data:03 let:04 implement:05 efficient:05 seems:05 aug:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 8 Aug 2003, Matt Gushee wrote: > On Thu, Aug 07, 2003 at 03:16:49PM -0500, Brian Hurt wrote: > > > > In the general case, this is hard. In this specific case, you might > > consider just hard coding your levels. So you'd end up with a data > > structure like: > > > > All font > > / | \ > > / | \ > > medium bold light <-- pick the weight > > / | \ > > [ ..... ] > > Interesting idea, and not one that I had considered at all. It seems > quite efficient, too. On the other hand, it looks like the fixed search > path would make it rather hard to implement fallback rules in case an > exact match isn't found. It seems to me that that's fairly important for > fonts: there are many situations where it is preferable to produce some > output with some fonts not quite right rather than producing nothing. You certainly can handle * rules by just concatenating results from the different children. You could also do something like: match weight with "medium" -> let t = get_style tree.medium ... in match t with _ :: _ -> (* we have at least one font *) t | [] -> (* try getting something in bold *) let t = get_style tree.bold in ... Brian ------------------- 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