Re: Why is "." a decimal number? (NSScanner question)
Re: Why is "." a decimal number? (NSScanner question)
- Subject: Re: Why is "." a decimal number? (NSScanner question)
- From: Jim Rankin <email@hidden>
- Date: Mon, 7 Jun 2004 10:09:23 -0400
On Jun 4, 2004, at 5:25 PM, Ondra Cada wrote:
>
In a sense, yes. Many of us often write "10." for ten (to distinguish
>
it from an int), and many of us often write ".3" for three tenths.
>
>
I would say that, given the two facts above, the best of all
>
possibilities is indeed to treat "." a zero.
>
I certainly agree that "10." and ".3" are valid decimal numbers, but
not ".mac", nor should it be interpreted as a 0 decimal number followed
by "mac".
But I think the issue is that I have overestimated NSScanner's
capabilities, in that it probably doesn't peek ahead to confirm it's
guesses and backtrack if it's wrong. That seems consistent with your
explanation, at least. Makes sense, as I imagine that one of the goals
for NSScanner is efficiency.
Thanks to all who responded.
-jimbo
Excelsior! XML Marshaller for Cocoa
http://www.homepage.mac.com/jimbokun/Excelsior.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.