I believe your best bet is the 'if .. then .. else' chain. You may
also use 'when' clauses in pattern matching, but those don't scale too
well and are best avoided if their are the only content of your
content: pattern matching are good for structural deconstruction and
environment binding, but can be confusing and useless when you are
using none of those aspects.

On Sat, Jan 21, 2012 at 7:14 PM, Pierre Chopin <[email protected]> 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
> [email protected]
>


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to