What Makes A Programming Language Good
Vladimir Panteleev
vladimir at thecybershadow.net
Tue Jan 18 06:30:54 PST 2011
On Tue, 18 Jan 2011 15:51:58 +0200, Adam Ruppe <destructionator at gmail.com>
wrote:
> Jim wrote:
>> Why can't the compiler traverse this during compilation in order to
>> find all relevant modules and compile them if needed?
>
> How will it find all the modules? Since modules and files don't
> have to have matching names, it can't assume "import foo;" will
> necessarily be found in "foo.d". I use this fact a lot to get
> all a program's dependencies in one place.
I think this is a misfeature. I suppose you avoid using build tools and
prefer makefiles/build scripts for some reason?
> The modules don't necessarily have to be under the current
> directory either. It'd have a lot of files to search, which might
> be brutally slow.
Not if the compiler knows the file name based on the module name.
> ... but, if you do want that behavior, you can get it today somewhat
> easily: dmd *.d, which works quite well if all the things are in
> one folder anyway.
...which won't work on Windows, for projects with packages, and if you
have any unrelated .d files (backups, test programs) in your directory
(which I almost always do).
--
Best regards,
Vladimir mailto:vladimir at thecybershadow.net
More information about the Digitalmars-d
mailing list