On Mon, 28 Apr 2014 11:09:38 -0400, Byron <[email protected]> wrote:

I am confused now, cross module renaming??

I was thinking this:

a.d
extern(C++, std) {  ... class string ... }

class string now has two fully-qualified names. a.string, and std.string (assuming the current DIP is implemented).

b.d
import std.string;
import cpp = a; // a must be accessed via cpp

This renames the a *module*, but not the C++ namespace. The C++ namespace is entirely separate from D's module imports.

So now, a's string has two names, cpp.string and std.string (still).

std.string.... /// okay D version

Error. Refers both to the std.string module, and the string class within the std C++ namespace.

cpp.std.string ... /// okay c++ version

I don't think this would work either. This is a mix of D modules, and C++ namespaces. The DIP does not mention this possibility.

string ... /// Okay D version

I think this may work.

cpp.string /// Okay C++ version

Yes.

-Steve

Reply via email to