[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Proposing amending char-numeric? definition
- To: Shiro Kawai <shiro.kawai@x>
- Subject: Re: [Scheme-reports] Proposing amending char-numeric? definition
- From: John Cowan <cowan@x>
- Date: Wed, 27 Apr 2011 21:58:49 -0400
- Cc: Scheme-reports@x
- In-reply-to: <BANLkTi=5rWkaW3s+pL5UjrD=N11mcphTQg@mail.gmail.com>
- References: <BANLkTi=5rWkaW3s+pL5UjrD=N11mcphTQg@mail.gmail.com>
Shiro Kawai scripsit:
> (1) Define char-numeric? returns #t if the character's Numeric_Type
> property value is other than 'None'.
AFAICT no Scheme supports this definition.
> (2) Drop char-numeric?, and add char-numeric-type and
> char-numeric-value. The former returns the value of Numeric_Type
> property, and the latter returns the value of Numeric_Value property.
> This should be the way to provide access to a character's Unicode
> "Numeric" property.
Dropping an IEEE Scheme procedure is out of scope.
> (3) Define char-numeric? to return #t only for 0,1,2,3,4,5,6,7,8 and
> 9. This retains the compatibility to 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
Gauche, Gambit, and Chicken (without the utf8 egg) work like this.
(4) Define char-numeric? to return #t for decimal digits only (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 value of Nd, Nl, No). Scheme48, Chez, and Ikarus work like
He played King Lear as though John Cowan <cowan@x>
someone had played the ace. http://www.ccil.org/~cowan
Scheme-reports mailing list