On 02/11/2009, at 4:50 PM, John Joyce wrote:
Category, yeah, that's totally one way I thought about, but I was thinking more of an enhancement request in Radar. I figured the nature of it inheriting from NSObject implies there are some kind of optimizations under the hood (otherwise we'd just use NSString and NSScanner right?). Seems like a useful one considering the characterSetWithCharactersInString: method. Even if it were some sort of singleton class. Particularly useful in input validation routines (things like highly structured serial numbers and other identifiers, etc...) If there is consensus from multiple people on an enhancement request and the functionality and justification for it, I'll be happy to file it.
What is your proposed character set going to contain? Is it of ultra- widespread utility?
Otherwise, this is what categories are for - to add enhancements yourself in a few moments instead of waiting (possibly years) for Apple to do it for you. I don't really see that there is a case here for a radar enhancement request, but it would depend on what you have in mind.
As for optimisations, I don't quite follow your argument - NSCharacterSet is not equivalent to NScanner + NSString, though it sometimes will get used with those classes. I expect the common built- in "constant" sets are there because they are of very widespread utility - e.g. stripping whitespace, but are probably not using much in the way of magic optimisations.
--Graham _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com