This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 164: Meaning of char-numeric?

2012-10-05 12:39:55
WG1 - Core
cowan
major
cowan
fixed
source
closed
2011-04-28 09:56:34
defect

The current draft, like R6RS, defines char-numeric? according to the nonexistent Unicode Numeric property. That has to be fixed. Options:

  1. char-numeric? returns #t if the character's Numeric_Type property value is other than None. This means that many hanzi are both alphabetic and numeric.
  1. (Omitted, because it does not preserve IEEE Scheme)
  1. Define char-numeric? to return #t only for 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. This retains compatibility witht R5RS, and we can still use char-numeric? to parse numbers, and safely use (- (char->integer c) (char->integer #\0)) to obtain the digit value the character represents. (Note: R5RS programs that use char-numeric? to parse numbers will break if we adopt the current draft's definition of char-numeric?). Gauche, Gambit, and Chicken (without the utf8 egg) work like this.
  1. Define char-numeric? as equivalent to the Numeric_Digit property (general category value of Nd). Guile 2.0, Kawa, Larceny, Ypsilon, Mosh, and IronScheme work like this.
  1. define char-numeric? as equivalent to the Number property (general category values of Nd, Nl, No). Scheme48, Chez, and Ikarus work like this.
descriptionThe current draft, like R6RS, defines `char-numeric?` according to the nonexistent Unicode Numeric property. That has to be fixed. Options: 1. `char-numeric?` returns `#t` if the character's Numeric_Type property value is other than `None`. This means that many hanzi are both alphabetic and numeric. 2. (Omitted, because it does not preserve IEEE Scheme) 3. Define char-numeric? to return #t only for 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. This retains compatibility witht R5RS, and we can still use `char-numeric?` to parse numbers, and safely use `(- (char->integer c) (char->integer #\0))` to obtain the digit value the character represents. (Note: R5RS programs that use `char-numeric?` to parse numbers will break if we adopt the current draft's definition of `char-numeric?`). Gauche, Gambit, and Chicken (without the utf8 egg) work like this. 4. Define `char-numeric?` as equivalent to the Numeric_Digit property (general category value of Nd). Guile 2.0, Kawa, Larceny, Ypsilon, Mosh, and IronScheme work like this. 5. define `char-numeric?` as equivalent to the Number property (general category values of Nd, Nl, No). Scheme48, Chez, and Ikarus work like this. The current draft, like R6RS, defines `char-numeric?` according to the nonexistent Unicode Numeric property. That has to be fixed. Options: 1. `char-numeric?` returns `#t` if the character's Numeric_Type property value is other than `None`. This means that many hanzi are both alphabetic and numeric. 2. (Omitted, because it does not preserve IEEE Scheme) 3. Define `char-numeric?` to return `#t` only for 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. This retains compatibility witht R5RS, and we can still use `char-numeric?` to parse numbers, and safely use `(- (char->integer c) (char->integer #\0))` to obtain the digit value the character represents. (Note: R5RS programs that use `char-numeric?` to parse numbers will break if we adopt the current draft's definition of `char-numeric?`). Gauche, Gambit, and Chicken (without the utf8 egg) work like this. 4. Define `char-numeric?` as equivalent to the Numeric_Digit property (general category value of Nd). Guile 2.0, Kawa, Larceny, Ypsilon, Mosh, and IronScheme work like this. 5. define `char-numeric?` as equivalent to the Number property (general category values of Nd, Nl, No). Scheme48, Chez, and Ikarus work like this.
resolution
statusnewdecided

We voted for the Numeric_Digit property.

owneralexshinncowan
statusdecidedwriting
resolutionfixed
statuswritingclosed