[cfe-dev] Adding namespaces to Objective-C
Nathan Day
nathan_day at mac.com
Fri Nov 12 03:29:11 PST 2010
When I initially got into Objective-C one of the things I thought Objective-C needed was namespaces, but as I have worked more with Objective-C I have come to see Objective-C as a very pragmatic language. Namespace in Objective-C would be nice, but it seems to be more about ticking off the namespace box in feature lists than to solve real problems. I have never come into a situation where lack of namespaces was a problem, I sure others have, but has that really been that much of an issue. Namespace for classes/protocols etc would be simple and not break anything, but I don't know how namespaces for methods would work. One of the feature of objective-C is duck typing, I don't see how namespaces would work with that.
On 12/11/2010, at 5:41 AM, jahanian wrote:
> My two cents. Let's absolutely positively not have namespace for objective-c.
>
> 1. Somehow c has survived 30+ years not needing namespaces. I am told that it is not on the table yet.
> When, and if, namespaces appear for c, it can extend to objc as needed.
> 2. For objective-c++, make objective-c live, and thrive, using c++'s namespace.
>
>
> - fariborz
>
> On Nov 11, 2010, at 8:34 AM, Owen Shepherd wrote:
>
>> On 11 Nov 2010, at 13:37, Ariel V Feinerman wrote:
>>
>>> Everyone strongly discourages the use "using namespace" since the objects from tens used namespaces can clashes, well then to make short namespace names we can use aliases, but would they clash like prefixes?
>>>
>>
>> Indeed, though there are other useful uses of it (e.g. before C++0x's "inline namespaces" support, I have used it in order to give binary incompatible versions of a library different symbols). It is also perfectly acceptable for the library implementer to do
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Nathan Day
http://homepage.mac.com/nathan_day/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101112/d9e5ee90/attachment.html>
More information about the cfe-dev
mailing list