discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C Namespacing


From: Helge Hess
Subject: Re: Obj-C Namespacing
Date: Thu, 4 Dec 2003 21:45:14 +0100

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?

If we are talking about class namespaces (not selector namespaces), this should be a non issue. Isn't that already done in the Apple Java bridge, mapping Java classes as Objective-C classes with their respective names (eg org.gnustep.MyReflectedJavaClass)?

I guess that would be actually quite compatible even with sources compiled with older GCCs in practice. Eg a bundle class name is located using the principal class, that is, with a table lookup. The bundle could be completely hide its internal classes using namespaces, yet still be usable. "Hard" linked libraries/frameworks could still expose the public classes in the default namespace yet implement the internals using namespaces.

As a suggestion, use
---snip---
@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?

regards,
  Helge
--
I'm describing in a paragraph what took 14 hours to figure out. You may want to sniff glue for a while, then reread this when you get out of rehab. [aLa]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]