Making D Lang More easy.
Jonathan M Davis
jmdavisProg at gmx.com
Wed May 11 09:17:42 PDT 2011
On 2011-05-11 07:22, Mafi wrote:
> The module system has been given much attention so that the import order
> doesn't matter and you cannot use an ambigous symbol without error.
> Because there's no VM, you have to import everything you want to use.
> If you know C++, think of it like #include and using namespace x; at the
> same time.
> http://d-programming-language.org/module.html#ImportDeclaration
That's an odd comment to make. D's import is very similar to Java's import and
is far more like Java's import than C/C++'s #include. D is probably pickier
about possible name conflicts, but in general, importing in D and Java and
pretty much the same. You're specifically importing _modules_ in D, and D
doesn't enforce 1 public class per file, so the syntax is a bit different when
importing specific classes rather than a whole module, and you do have to deal
with the possibility of conflicting free functions whereas they aren't even
legal in Java, but overall importing in Java and D and pretty similar. I don't
know why you'd be comparing D's import to C/C++'s #include rather than Java's
import.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list