• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is "." a decimal number? (NSScanner question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Why is "." a decimal number? (NSScanner question)
      • From: Ondra Cada <email@hidden>
References: 
 >Why is "." a decimal number? (NSScanner question) (From: Jim Rankin <email@hidden>)
 >Re: Why is "." a decimal number? (NSScanner question) (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Windowless printing ?
  • Next by Date: Re: NSDictionary design bug (was: Re: Ugly bug in Foundation, beware!)
  • Previous by thread: Re: Why is "." a decimal number? (NSScanner question)
  • Next by thread: Re: Why is "." a decimal number? (NSScanner question)
  • Index(es):
    • Date
    • Thread