4 ms·
A month ago, Kyle Sluder proposed a namespacing system for Objective-C[1]. There has been a lively discussion both in the comments and on the objc-language mail
by sjmulder 14y ago
A month ago, Kyle Sluder proposed a namespacing system for Objective-C[1]. There has been a lively discussion both in the comments and on the objc-language mailing list[2].
1: http://www.optshiftk.com/2012/04/draft-proposal-for-namespaces-in-objective-c/ http://www.optshiftk.com/2012/04/draft-proposal-for-namespac...
2: http://lists.apple.com/archives/objc-language/2012/Apr/msg00000.html http://lists.apple.com/archives/objc-language/2012/Apr/msg00...
- aufreak3 14y agoThis is interesting, but doing it all at the compiler and language level seems like overkill. ObjC is a dynamic language, so the important thing is to have namespacing support in the runtime. If the user of a framework or bundle can specify a (reified) namespace to load a bundle's classes/protocols/etc and the runtime and language support A.B.C style class and protocol names, that might be enough to solve name collision problems. The framework/bundle author need not then bother to find a suitable globally unique name. This would certainly be enough to solve the original poster's problem. I'm not sure I've thought through all issues with the above approach, but the whole @namespace thing seems gross overkill to me.