The new, new phobos sneak preview

bearophile bearophileHUGS at lycos.com
Sun Apr 12 02:09:20 PDT 2009


Bill Baxter:
> But since pull-everything-in *is* the default.  I agree with Lars.
> Symbols supplied by modules should look unambiguous even when
> undecorated by their module name.  Or you could use the trick that
> Tango often uses -- make a static struct with a few members.  It's
> pretty ugly though, if you ask me.  Introducing a static struct just
> to get a namespace to replace the namespace that is already there but
> gets stripped as the default action upon 'import'.  Ick.

I'm waiting still for the design of the D2 module system to be fixed to something more rational than the current one.

The following has to import only the module name "foo" in the current namespace:
import foo;

This is a syntax that imports into the current namespace all the names contained into the "foo" module (but it doesn't import the "foo" name itself):
import foo: *;

This imports the "bar" and "baz" names into the current namespace (but it doesn't import the "foo" name itself):
import foo: bar, baz;

This fixes several problems. It also allows me to have a "foo" name inside the "foo" module without troubles (as the current system leads me to).

Be well,
bearophile



More information about the Digitalmars-d mailing list