for in D versus C and C++

Sean Kelly sean at invisibleduck.org
Fri Mar 20 12:08:35 PDT 2009


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Rioshin an'Harthen wrote:
> > "Walter Bright" <newshound1 at digitalmars.com> kirjoitti viestissä
> >> I doubt anyone types { } by accident.
> >
> > I have a habit of indenting the semicolon on the following line, if I
> > wanted a blank statement, like
> >
> > for (...; ...; ...)
> >    ;
> >
> > Much clearer in my opinion than having it on the same line as the for
> > construct.
> Yes, that's ok, too. The only issue with it as far as working it into
> the language goes is then the parser and lexer do not have a clean
> separation - whitespace has meaning in one case.

Sounds like HTTP/HTML.  The best I've come up with so far for parsing
that stuff is to have the lexer actually return tokens representing whitespace
in some instances.  It's totally ridiculous.



More information about the Digitalmars-d mailing list