Block close check

Luís Marques luismarques+spam at gmail.com
Sat Dec 9 14:10:20 PST 2006


Hi,

Seeing that the following use of comments is very common:

#ifndef _BLA_H_

while (1)
{
    ...
   for(;;)
   {
      ..
   } // for
} // while

#endif // _BLA_H_

Perhaps this could be unenforced by the compiler. For instance:

version(Windows)
{

void doit(int i)
{
   while(i > 0)
   {
      ...
     do lot of stuff();
      ...
   }(while)
}(doit)

}(version)

What do you think? I tend to avoid these kinds of comments, but for 
those who use them and for those situations where they are really 
necessary it would be a lot better to have a compiler enforce it than to 
have a commentary that might even be incorrect.

Better syntaxes could be invented, I just wanted an opinion on the gist 
idea.


Luís



More information about the Digitalmars-d mailing list