[Issue 16532] Add "namespace" Keyword?

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Oct 22 09:22:05 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16532

Mathias Lang <mathias.lang at sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mathias.lang at sociomantic.co
                   |                            |m

--- Comment #4 from Mathias Lang <mathias.lang at sociomantic.com> ---
> Really namespaces already exist in D, just they are very crudly implemented by either meaning horrible to maintain with a bunch of extra module files or through the use of structs. Adding namespaces would just be for sanity so that code like above isn't possible and so that namespaces are treated as such. As well adding namespace keyword will also help port from C++ if there is any code that needs it. Just a thought for a small improvement.

First, this is an enhancement proposal, thus it should go through the DIP
process:
https://github.com/dlang/DIPs/

Second, namespacing in D are supported through module / packages.
You can choose to introduce extra namespacing without introducing new
modules/packages by using aggregates as already mentioned, but it sounds like
your real problem is trying to code with a C++ approach in D.

--


More information about the Digitalmars-d-bugs mailing list