Opened 6 years ago

Closed 4 years ago

#164 closed defect (fixed)

Meaning of char-numeric?

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description (last modified by cowan)

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.

Change History (4)

comment:1 Changed 6 years ago by cowan

  • Description modified (diff)

comment:2 Changed 6 years ago by alexshinn

  • Status changed from new to decided

We voted for the Numeric_Digit property.

comment:3 Changed 6 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:4 Changed 4 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.