[racket-dev] Character classification
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.
http://docs.racket-lang.org/r5rs-std/r5rs-Z-H-9.html?q=char-numeric%3F#%_idx_490
"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