[racket-dev] Character classification

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Sep 4 13:07:23 EDT 2012

2012/9/4 Pierpaolo Bernardi <olopierpa at gmail.com>:
> On Tue, Sep 4, 2012 at 3:11 PM, Jens Axel Søgaard <jensaxel at soegaard.net> wrote:
>> Since the R5RS version of char-numeric? (according to the documentation)
>> tests for the ten digits, you can use:
>> (require (only-in r5rs char-numeric?))
> Thanks Jens Axel.  However, the r5rs version appears to be the same as
> the Racket version.

I consider that a bug.

"The numeric characters are the ten decimal digits."

Note that meaning changed in R6RS:
"A character is numeric if it has the Unicode “Numeric” property."

So the current Racket behaviour matches R6RS.

/Jens Axel

Tested with:
> ========
> #lang r5rs
> (define (test)
>   (let again ((i 0))
>     (cond ((< i #xD800)
>            (let ((c (integer->char i)))
>              (cond ((char-numeric? c)
>                     (display (list i c))
>                     (newline)))
>              (again (+ i 1)))))))
> ========

Jens Axel Søgaard

Posted on the dev mailing list.