From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr 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 q0LIU9fL013929 for ; Sat, 21 Jan 2012 19:30:09 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgABAP0DG0/RVda2kGdsb2JhbABChQmpBwgiAQEBAQkJDQcUBCGBcgEBAQQSAg8EGQE4AQMMAQUFCw0CAiYCAiISAQUBHAYTIqJYCosigzeEKIkwAgULgSSJYYEWBIg7jF2OET2BUIJN X-IronPort-AV: E=Sophos;i="4.71,548,1320620400"; d="scan'208";a="128363968" Received: from mail-tul01m020-f182.google.com ([209.85.214.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Jan 2012 19:30:04 +0100 Received: by obcwo16 with SMTP id wo16so3319186obc.27 for ; Sat, 21 Jan 2012 10:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jSKkzMiXrGYwtdU1R6l2vZK1GBDUb9g07EQ4rAr1E5c=; b=KpoSDtP3ODSwAaiZvbsECoJTHaWkRKn85dqYGn57GXqJ06OdoxooEpfifi6jXC4JUW w/yFYCmEDUX8Q+PYfw8n2WE3XH2JfYIMS3I/fRQSUcvgmDOCGg50Bc8PIwCRkYCkdJw9 555qnksr9U6/A+bFwqZnZW/43PENpC6koS0/k= MIME-Version: 1.0 Received: by 10.182.38.70 with SMTP id e6mr2311167obk.13.1327170603037; Sat, 21 Jan 2012 10:30:03 -0800 (PST) Sender: till.varoquaux@gmail.com Received: by 10.182.28.198 with HTTP; Sat, 21 Jan 2012 10:30:02 -0800 (PST) In-Reply-To: References: Date: Sat, 21 Jan 2012 13:30:02 -0500 X-Google-Sender-Auth: jR79WzbpY4E1ThNEQkEPohi3lwA Message-ID: From: Till Varoquaux To: Pierre Chopin Cc: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q0LIU9fL013929 X-Validation-by: till@pps.jussieu.fr Subject: Re: [Caml-list] pattern matching on integer intervals 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 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 >