Issue 11666: "Separation of platforms", and module declaration

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 9 02:06:15 PDT 2014


On Saturday, 9 August 2014 at 06:00:05 UTC, Mike wrote:
> On Saturday, 9 August 2014 at 05:38:33 UTC, H. S. Teoh via
>> What about this:
>>
>> 	// port.d
>> 	module port;
>> 	version(linux)
>> 		public import port_linux;
>> 	version(Windows)
>> 		public import port_windows;
>>
>> 	// port_linux.d
>> 	... // Linux implementation here
>>
>> 	// port_windows.d
>> 	... // Windows implementation here
>>
>
> Doesn't that introduce a new namespace?

It will have "dual" namespace - both `port.symbol` and 
`port_linux.symbol` will be valid qualified paths (though 
fullyQualifiedName!symbol is likely to show the latter)


More information about the Digitalmars-d mailing list