Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!rocksanne!sunybcs!kitty!baylor!peter From: peter@baylor.UUCP (Peter da Silva) Newsgroups: net.lang.c++ Subject: Re: Re: Unintuitive semantics for initializing in for statements Message-ID: <652@baylor.UUCP> Date: Thu, 15-May-86 02:39:38 EDT Article-I.D.: baylor.652 Posted: Thu May 15 02:39:38 1986 Date-Received: Sun, 18-May-86 12:28:00 EDT References: <17195@rochester.ARPA> <5334@alice.uUCp> <101@cstvax.UUCP>, <224@tuck.nott-cs.UUCP> <805@bentley.UUCP> Organization: The Power Elite, Houston, TX Lines: 20 > In article <224@tuck.nott-cs.UUCP> nott-cs!anw (Andy Walker) writes: > >In article <101@cstvax.UUCP> db@cstvax.UUCP (Dave Berry) writes: > >> An alternative would be to have a 'for' expression - the same as a 'for' > >> statement except that it returns the value of the iteration variable on > >> exit. > > Not all "for" statements *have* an iteration variable. > > In C++, it's not so bad having statements which are not expressions, because > you can just make a one-statement inline function and use "return". How about going back to BCPL and allow *any* block to have a value that is returned by "return" (or use the BCPL keyword "resultis")? I have a question about C++: what is "cout << value"? I presume that's supposed to print the value in an appropriate format, but I can't figure why "cout". Why not "print value..."? -- -- Peter da Silva -- UUCP: ...!shell!{baylor,graffiti}!peter; MCI: PDASILVA; CIS: 70216,1076