[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] digit-value



Alaric Snell-Pym scripsit:

> >> char-numeric? certainly seems to be of limited use without it, but
> >> is the char-numeric?/digit-value pair actually useful at all in the
> >> scope of WG1, given string->number?
> >
> > Unless we are to extend `string->number` to handle non-European
> > digits (and then `read`, and then numeric literals?), I think so.
> 
> Well, if digit-value exists and handles all those fun cases, then I
> think that read (and, therefore by definition, numeric literals), should
> do so too for consistency and to avoid having to have two parallel
> digit->number conversions lurking inside every implementation, one a
> subset of the other.

It doesn't.  Digit-value handles a single character only; string->number
handles a string, as its name indicates.  A trivial implementation of
digit-value can be found at http://trac.sacrideo.us/wg/ticket/220 .
As noted there, digit-char-p is the CL equivalent of char-numeric? and
digit-value combined.

-- 
Principles.  You can't say A is         John Cowan <cowan@x>
made of B or vice versa.  All mass      http://www.ccil.org/~cowan
is interaction.  --Richard Feynman

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports