proposal: improved import declaration

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed May 30 10:35:26 PDT 2007


eao197 wrote:
> On Wed, 30 May 2007 18:23:02 +0400, Frits van Bommel 
> <fvbommel at REMwOVExCAPSs.nl> wrote:
> 
>> This works quite nicely. I would imagine it'd work even better in 
>> build utilities that can use the complete power of D (or another 
>> high-level language) to parse the output instead of being restricted 
>> to (interpreted) shell commands. (And it wouldn't need all of the 
>> above steps, since they don't need to generate make-compatible syntax)
> 
> Thanks for your example.
> I want to add support of D to my build tool which is written in Ruby. I 
> think your approach can save me a lot of work in implementing dependency 
> analyzer.

It certainly made my life a lot easier when I found out '-v' showed 
imports (prior to that I grepped for 'import' statements, using sed to 
change '.' to '/' and adding '.d'...).
And it got even better when it also started showing the filenames, since 
I had several '-I' parameters on the command line that would all have to 
be searched[1] to get it working just right.

But now the compiler reports filenames it works perfectly without 
anything too hackish :).


[1]: Which I didn't do by the way; I just assumed imports were from my 
main import path, which caused some trouble once in a while if a file 
located elsewhere was changed and I forgot to do a 'make rebuild' 
instead of 'make'...



More information about the Digitalmars-d mailing list