caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Till Varoquaux <till@pps.jussieu.fr>
To: Pierre Chopin <pierre@punchup.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] pattern matching on integer intervals
Date: Sat, 21 Jan 2012 13:30:02 -0500	[thread overview]
Message-ID: <CAHJESt1unukgAk4x14Si5pSytLUZUat8OpHS+0Bkg6cn-X3E5w@mail.gmail.com> (raw)
In-Reply-To: <CAGyUfm3w0dnk0DwK=kGpNAb5o1b8ehEXDcC07zWLdH5BwCHf5w@mail.gmail.com>

I remember wondering the same thing and the answer can be found in the
ocaml parser: char intervals are expanded at parse time to the the
full list of characters. This would blow up if you were to use ints,
int64 etc....

HTH,
Till

On Sat, Jan 21, 2012 at 1:14 PM, Pierre Chopin <pierre@punchup.com> 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?
>
> --
> Pierre Chopin,
> Chief Technology Officer and co-founder
> punchup LLC
> pierre@punchup.com
>


  reply	other threads:[~2012-01-21 18:30 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 [this message]
2012-01-21 18:33 ` Gabriel Scherer
2012-01-21 19:46 ` Edgar Friendly

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=CAHJESt1unukgAk4x14Si5pSytLUZUat8OpHS+0Bkg6cn-X3E5w@mail.gmail.com \
    --to=till@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    --cc=pierre@punchup.com \
    /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).