DIP61: Add namespaces to D

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 28 07:03:01 PDT 2014


On Monday, 28 April 2014 at 13:54:05 UTC, Steven Schveighoffer 
wrote:
> On Mon, 28 Apr 2014 09:23:17 -0400, Dicebot <public at dicebot.lv> 
> wrote:
>
>> On Monday, 28 April 2014 at 13:20:19 UTC, Steven Schveighoffer 
>> wrote:
>>> And actually, this would have to be std.clock.currTime 
>>> (std.datetime.clock.currTime?)
>>>
>>> What you are looking for is renamed imports.
>>>
>>> import std.datetime.clock = clock;
>>>
>>> Which cannot be enforced. and that is really the problem.
>>>
>>> -Steve
>>
>> "static module"?
>
> I haven't heard of that feature, is that a proposal? doesn't 
> seem to work in the latest release.
>
> BTW, I got my syntax wrong, it should be:
>
> import clock = std.datetime.clock;
>
> -Steve

Yeah, it is just a random idea I have just had. Something like 
this:

// a.d
static module a;
void foo() {}

// b.d
import a; // error
import a = a; // ok
static import a; // ok
import a : foo; // error
import a : a_foo = foo; // ok


More information about the Digitalmars-d mailing list