Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!topaz!gaynor From: gaynor@topaz.RUTGERS.EDU (Silver) Newsgroups: net.lang Subject: re: re: compound statements Message-ID: <5287@topaz.RUTGERS.EDU> Date: Sat, 5-Jul-86 21:41:22 EDT Article-I.D.: topaz.5287 Posted: Sat Jul 5 21:41:22 1986 Date-Received: Sun, 6-Jul-86 04:31:28 EDT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 42 [oh give me a home, where the line-eaters rome, and the...] ark@alice.UucP (Andrew Koenig) writes... > [...!topaz!gaynor writes] > > > In many languages, the body of a program or subprogram consists of a > > compound statement. This seems like an arbitrary restriction, and is > > quite annoying at times. Often the action of a program or subprogam > > is expressable as a single statement, and I would never otherwise > > enclose a single statement within a compound statement. > > What languages? > > The only one that comes to mind is C. I suspect that it makes parsing > much easier in C. Oh, a couple of languages come to mind. Particularly Algol (?) and its descendants, C, Pascal, and Ada (to name a few biggies). There are plenty of others. 10 pts to the one who can name the most. !!Simpler parsing methods is *NO*EXCUSE* for compromising a language!! May you someday be forced to program in microcode (knock on wood :-). I'm sure many compiler schemes would surely handle the removal of this restriction no problem. Especially those that are generated by a compiler generator. I myself modified my Compilers-1 project (a simple recursive-descent compiler for a subset of Pascal) to do (sub)program bodies this way in about four minutes. One good thing about this modification is that all existing code still works. _ /| \`o_O' ( ) Aachk! Phft! U Disclaimer: The opinions and/or information and/or code expressed here were generated by this characature (stolen from Dave Rasmussen, to which I have taken the liberty of adding ears). So don't look to me for a disclaimer! Silver {...!topaz!gaynor}