|
From: | Ziemowit Laski |
Subject: | Re: Obj-C Namespacing |
Date: | Thu, 4 Dec 2003 13:41:34 -0800 |
On 4 Dec 2003, at 12.45, Helge Hess wrote:
On 04.12.2003, at 20:35, Ziemowit Laski wrote:That's right. I believe that adding namespaces to ObjC/ObjC++ constructs would actually require adding namespace support to the runtime, and runtime metadata. :-(Where do you see problems?
I can't think of anything too problematic, actually, aside from actually agreeing to do it. One would have to come up with a way to "mangle" ObjC class/protocol names so that they contain namespace qualifications and do not collide with names constructed by hand. (E.g., mangling 'org.gnustep.MyClass' as 'org_gnustep_MyClass' would not do, although you're probably right that leaving it as 'org.gnustep.MyClass' might just do the trick.)
@namespace org.gnustep; @interface MyClass : com.apple.Foundation.NSObject - (id)blub; @end @end ---snap---Should work and produce "org.gnustep.MyClass" as the class name in the class lookup table.Do I miss anything?
If you did, I can't see it. :-( My first inclination was to rely on C++ namespace notation, but that would mean that only ObjC++ users could benefit from the features. Your notation could work with both ObjC and ObjC++, and seems quite reasonable.
--Zem
[Prev in Thread] | Current Thread | [Next in Thread] |