[racket-dev] Character classification

2012-09-04 Thread Pierpaolo Bernardi
The non-cooperation between char-numeric? and string-number is very annoying. I had to resort to: (define (my-char-numeric? c) (char=? #\0 c #\9)) Maybe I am missing a function similar to my-char-numeric? somewhere in the Racket docs? FWIW, my humble opinion is that char-numeric? should be

[racket-dev] Character classification

2012-09-04 Thread Pierpaolo Bernardi
The non-cooperation between char-numeric? and string-number is very annoying. I had to resort to: (define (my-char-numeric? c) (char=? #\0 c #\9)) Maybe I am missing a function similar to my-char-numeric? somewhere in the Racket docs? FWIW, my humble opinion is that char-numeric? should be

Re: [racket-dev] Character classification

2012-09-04 Thread Jens Axel Søgaard
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?)) /Jens Axel 2012/9/4 Pierpaolo Bernardi olopie...@gmail.com: The non-cooperation between char-numeric? and string-number is very annoying. I

Re: [racket-dev] Character classification

2012-09-04 Thread Pierpaolo Bernardi
On Tue, Sep 4, 2012 at 3:11 PM, Jens Axel Søgaard jensa...@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

Re: [racket-dev] Character classification

2012-09-04 Thread Doug Williams
I would say your function would be better named is-digit? and that the char-numeric? is exactly what it is intended to be with respect to Unicode characters, which is what a Racket character represents. On Tue, Sep 4, 2012 at 4:37 AM, Pierpaolo Bernardi olopie...@gmail.com wrote: The

Re: [racket-dev] Character classification

2012-09-04 Thread Pierpaolo Bernardi
On Tue, Sep 4, 2012 at 3:56 PM, Doug Williams m.douglas.willi...@gmail.com wrote: I would say your function would be better named is-digit? Good point. However, many of the characters which are char-numeric? are digits too, in other writing systems. and that the char-numeric? is exactly what

Re: [racket-dev] Character classification

2012-09-04 Thread Sam Tobin-Hochstadt
On Tue, Sep 4, 2012 at 10:57 AM, Pierpaolo Bernardi olopie...@gmail.com wrote: What is annoying is that char-numeric? and string-number are not compatible. `char-numeric?` and `string-number` would not be compatible in the sense you're thinking of, even with the change you mention. For

Re: [racket-dev] Character classification

2012-09-04 Thread Pierpaolo Bernardi
On Tue, Sep 4, 2012 at 5:03 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Tue, Sep 4, 2012 at 10:57 AM, Pierpaolo Bernardi olopie...@gmail.com wrote: What is annoying is that char-numeric? and string-number are not compatible. `char-numeric?` and `string-number` would not be

Re: [racket-dev] Character classification

2012-09-04 Thread Jens Axel Søgaard
2012/9/4 Pierpaolo Bernardi olopie...@gmail.com: On Tue, Sep 4, 2012 at 3:11 PM, Jens Axel Søgaard jensa...@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