Path: utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!db From: db@lfcs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.c++ Subject: Re: Should C++ follow C's footsteps? Message-ID: <1503@etive.ed.ac.uk> Date: 1 Mar 89 16:45:36 GMT References: <4800051@m.cs.uiuc.edu> <8902@alice.uucp> <2438@crete.cs.glasgow.ac.uk> Sender: news@etive.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 28 In article grunwald@flute.cs.uiuc.edu (Dirk Grunwald) writes: >Right now, you can't say: > > for (int i = 0; ....... etc ); > for (int i = 0; ....... etc ); > >This is a case where a divergence from C would be useful (and it's not clear >to me it would break anything else) It wouldn't be a divergance from C, because C doesn't allow declarations at the start of a for loop. I also have a gripe with the C++ for loop, and that is that you can't say for (int i = 0; int j = 0; ....... etc ); because C uses semicolons to separate the different bits of the for loop. Perhaps C++ could use commas to separate declarations in this case, i.e. for (int i = 0, int j = 0; ....... etc ); This is like an extension of the comma operator, but would probably have to be limited to this part of the syntax to avoid clashes. Dave Berry, Laboratory for Foundations of Computer Science, Edinburgh. db%lfcs.ed.ac.uk@nss.cs.ucl.ac.uk !mcvax!ukc!lfcs!db