3 ms·
Draft Proposal for Namespaces in Objective-C
- officialchicken 15y agoIf there's an opposite to syntactic sugar, this is it. Good idea, horrible implementation. Other than the @namespace keyword, it needs to be thrown away and start over.
- makecheck 15y agoGenerally a useful thing to suggest, though it has some holes. The proposal to give selectors namespace awareness seems to be overlooking a pretty fundamental truth about selectors: they don't have context, they don't even belong to a particular class. There is therefore no ambiguity to be resolved; the selector "performAction:withArg:" is already isolated. Now, if you were to call something like "respondsToSelector:@selector(performAction:withArg:)" then you need a particular class or instance but again this should be clear from the context: in a new namespace-supporting Objective-C the object that you call this on should be clear and the selector expression itself should need no namespace at all. This namespace style may also be clinging a bit too much to the C++ approach. In particular the tendency to double-@end everything due to the namespace suggests a cleaner syntax is needed. Oddly this isn't consistent as sometimes "MyNS.MyClass" is used and in other cases @namespace/@end is used.