[M3devel] imports anywhere?

Olaf Wagner wagner at elegosoft.com
Mon Feb 11 14:17:56 CET 2008


Quoting Jay <jayk123 at hotmail.com>:

> Here is another SMALL gripe with the language.
> The need to put IMPORTS at the top (or is it just common style?),   
> leads to something I have seen several times.
> You comment out some code, thereby deleting the only/last use of   
> some import, that nets you warnings about unused imports. Granted,   
> they are "only" warnings, but I try to have none. Also granted, you   
> can either comment out or just go ahead and remove the imports, easy.
>
> It might be nice if the IMPORTS could be adjacent to the code using   
> the IMPORTS, so that they can be comment out or removed together.
>
> This "problem" is not unique to Modula-3, by far.
> In fact, Modula-3 is probably more able to warn about this low cost   
> waste due to its much better module system, compared to say, C and   
> C++ #includes..

I wouldn't like to see any changes here.

It is good that all the imports are explicit, and it is good that
they are at the top (to define the dependencies). It's not much
effort to add or remove an import for debugging etc.

If you are really lazy, you can always use the NOWARN pragma:

   IMPOPRT IO <*NOWARN*>

to suppres the warnings for that declaration. That was not your
point though.

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list