On Thu, 6 Dec 2001, Tom Hughes wrote: > In message <[EMAIL PROTECTED]> > James Mastros <[EMAIL PROTECTED]> wrote: > > > On Mon, 3 Dec 2001, Tom Hughes wrote: > > > It's completely wrong I would have thought - the encoding layer > > > cannot know that a given code point is a digit so it can't possibly > > > do string to number conversion. > > > > > > You need to use the encoding layer to fetch each character and > > > then the character set layer to determine what digit it represents. > > Right. And then you need to apply some unified logic to get from this > > vector of digits (and other such symbols) to a value. > > Indeed, and that logic needs to be in the string layer where it can > use both the encoding routines and the character type routines. I have > just rearranged things to reflect that. >
Yes, that does make more sense. I think we need some string docs. Also, for string -> integer conversion I think we ought to be scanning for a float then turning the result into an integer (as 1234.56e2 is one). We'll also eventually need a string->BigNum and string->BigInt conversion, and if things are to upgrade gracefully and silently this might need to happen as the string is scanned. Alex Gough