On 04/26/2014 08:15 PM, Walter Bright wrote:
On 4/26/2014 5:37 AM, Timon Gehr wrote:
import std.stdio;

namespace g{
     int foo(int a){ return a; }
}
namespace g{
     string foo(string a){ return a; }
}

void main(){
     writeln(foo(2));
     writeln(foo("a"));
     writeln(g.foo(2));
     writeln(g.foo("a"));
}

Both examples should still work if the two mixins/namespaces occur in
(possibly
different) imported modules. I think this would be in line with how
lookup is
generally handled in D. (Note that I am not suggesting to make namespaces
extensible, but rather to make them overloadable.) How do you think
about this?

Yes, that's how I anticipate it working.

Nice.

That's just following existing rules.


The example with the mixins does not actually compile. I have filed this:
https://issues.dlang.org/show_bug.cgi?id=12659

Reply via email to