caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] pattern matching on integer intervals
Date: Sat, 21 Jan 2012 14:46:03 -0500	[thread overview]
Message-ID: <4F1B15FB.1030900@gmail.com> (raw)
In-Reply-To: <CAGyUfm3w0dnk0DwK=kGpNAb5o1b8ehEXDcC07zWLdH5BwCHf5w@mail.gmail.com>

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.


      parent reply	other threads:[~2012-01-21 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21 18:14 Pierre Chopin
2012-01-21 18:30 ` Till Varoquaux
2012-01-21 18:33 ` Gabriel Scherer
2012-01-21 19:46 ` Edgar Friendly [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1B15FB.1030900@gmail.com \
    --to=thelema314@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).