Re: Why does NSArray count return NSUInteger?
Re: Why does NSArray count return NSUInteger?
- Subject: Re: Why does NSArray count return NSUInteger?
- From: Lee Ann Rucker <email@hidden>
- Date: Mon, 30 May 2011 18:21:12 -0700 (PDT)
>Unfortunately, somebody decided a long time ago, the same can't be done for integers, because there's no infinite-range numerical space available to machine computation (in any way that mainstream hardware supports directly), and no single finite-range space that (as in the floating point case) encompasses the others.
Smalltalk integers appeared to all be of the same Integer class, but behind the scenes they'd switch from primitive smallints to objects once they hit the smallint max (29 bits in 32-bit address space). But unless you were inside the virtual machine you couldn't tell objects from primitives anyway - every single thing you dealt with was an object.
But in a hybrid like ObjC, we sometimes have to play by C rules.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden