Walter Bright wrote: > bearophile wrote: >> Alex Makhotin: >>> Current DMD compiler version outputs on attempt to make empty statement: >>>> use '{ }' for an empty statement, not a ';' >>> Is there a reason? >> >> Yes, it avoids a common type of bug: >> >> for (int i = 0; i < 10; i++); >> writeln(i); >> >> I have seen students waste minutes locating that bug. > > I've seen a whole afternoon lost on that one.
Of course, using a decent editor will prevent it: if the editor is able to handle indentation correctly, it will indent the writeln in the same column as the for which makes the problem appear immediately. Jerome -- mailto:jeber...@free.fr http://jeberger.free.fr Jabber: jeber...@jabber.fr
signature.asc
Description: OpenPGP digital signature