DIP61: Add namespaces to D

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 11:13:01 PDT 2014


On 4/26/2014 8:19 AM, Timon Gehr wrote:
> Well, the proposed feature does not add any new capabilities except proper
> mangling. In pure D code
>
> namespace foo{
>      // declarations
> }
>
> would be basically the same as
>
> private mixin template Foo(){
>      // declarations
> }
> mixin Foo foo;

That's right.

> which is available today. I guess namespaces will occur in pure D code as
> sparsely as the above construction, because they are not particularly useful.

Yeah, template mixins turned out to be a solution looking for a problem.


More information about the Digitalmars-d mailing list