From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0LJkCtQ015135 for ; Sat, 21 Jan 2012 20:46:12 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgYBAJEVG0/RVaC2kGdsb2JhbABCgw2rBwgiAQEBAQkJDQcUBCGBcgEBAQQSAhMRCAEbHAIDDAYFCw0JFg8JAwIBAgEREQEFARwTCAEBHqJ5Cotqgm+EHz+IcQIFC4h/gxwEiDuMXYVWgTeHBD2EHQ X-IronPort-AV: E=Sophos;i="4.71,548,1320620400"; d="scan'208";a="128366682" Received: from mail-gy0-f182.google.com ([209.85.160.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Jan 2012 20:46:07 +0100 Received: by ghy10 with SMTP id 10so944313ghy.27 for ; Sat, 21 Jan 2012 11:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=5hJRSWCehjYAev4z67fs7DerJkBlkGQv0Z1V5FkRKBQ=; b=CSDZFeZf6SNICeRql/C7VMaX+0F867hcCGTu7yzy+/XMx0uaGoJMtXQ2dhEpOfkvt8 6Udwk5pkvKd5E73OewLep/1N6hmrhsBlD0PluQyIQp1WHI54UR7Rzt12N9udGrDGFvur n6bDuJo7EXqS03SYGAs4sqzTF9O1MqAfG4Dzc= Received: by 10.236.173.40 with SMTP id u28mr4169848yhl.15.1327175165880; Sat, 21 Jan 2012 11:46:05 -0800 (PST) Received: from [192.168.1.65] (99-121-78-10.lightspeed.lnngmi.sbcglobal.net. [99.121.78.10]) by mx.google.com with ESMTPS id a24sm19698175ana.13.2012.01.21.11.46.04 (version=SSLv3 cipher=OTHER); Sat, 21 Jan 2012 11:46:05 -0800 (PST) Message-ID: <4F1B15FB.1030900@gmail.com> Date: Sat, 21 Jan 2012 14:46:03 -0500 From: Edgar Friendly User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] pattern matching on integer intervals On 01/21/2012 01:14 PM, Pierre Chopin wrote: > Hi, > > I am trying to do pattern matching on unicode characters, represented by > integers. I would like to do something like that > > let f c = > match c with > 0xff .. 0xfff -> foo > > I know we can pattern match over char intervals but It doesn't be to be > the case for char intervals. Some I have two questions: > Is there a better way of doing what I am doing and why is it possible > to pattern match over char intervals and not int intervals? The author of Camomile wrote IMap and ISet to efficiently store maps/sets over a large domain where large ranges are the same. You may be able to use these DIET trees from camomile or from batteries to accomplish something along the lines of what you want. E.