On Sunday, 9 November 2014 at 13:17:37 UTC, AlanThinker wrote:
On Sunday, 9 November 2014 at 12:21:28 UTC, tcak wrote:
If we can create partial module, it will be easier to use. then
no package needed.
such as:
################
// test/foo/gui/button.d
partial module foo.gui;
class Button
{
public this() {
import std.stdio : writeln;
writeln( "New Button!" );
}
}
// test/foo/gui/widget.d
partial module foo.gui;
class Widget {
public this() {
import std.stdio : writeln;
writeln( "New Widget!" );
}
}
// test/foo/namespace.d
module namespace;
import foo.gui;
void main()
{
auto w = new foo.gui.Widget;
auto b = new foo.gui.Button;
}
###############
That's good, but there is no need to add a new keyword as
"partial" for module I think. If compiler would just merge same
modules together automatically, that would do it.