Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site bocklin.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!hao!noao!arizona!bocklin!gary From: gary@bocklin.UUCP Newsgroups: net.lang.mod2 Subject: Re: Aren't people fed up with semicolons yet? Message-ID: <125@bocklin.UUCP> Date: Fri, 12-Apr-85 13:39:05 EST Article-I.D.: bocklin.125 Posted: Fri Apr 12 13:39:05 1985 Date-Received: Sun, 14-Apr-85 06:49:07 EST References: <4003@mit-eddie.UUCP> Organization: Dept of CS, U of Arizona, Tucson Lines: 41 > Has anyone though of trying to see what would happen to Modula-2 syntax if > semicolons were optional, as in CLU? > ... > It just seems strange that one language (CLU) would not require explicit > terminators but another (Modula-2) would. After all, compilers can be > made smart enough to allow humans to type fewer superfluous symbols. > - Ralph Beware the ``superfluous'' claim. It has gotten us such wonders as the ``='' vs ``=='' problems in C. Certainly it is possible to make semicolons optional, but it has had strange side-effects, in the past. In an early version of Icon (I have not checked the problem recently), the code segment a:= ( ... very long expression ... ) + (another long expression) ; was treated as *two* statements. (Expressions really. Icon, like C, is an expression language.) ``a'' was assigned the value of the first expression and the second value was thrown away. After tearing hair, I finally figured out the problem and tried a:= ( ( ... very long expression ... ) + (another long expression) ); expecting the extra parentheses to make the expression one. Instead I got a syntax error complaining about the missing right parenthesis before the ``optional'' semicolon at the end of the first line, and a second error about the extra right parenthesis on the second line. The correct ``fix'' was to write a:= ( ... very long expression ... ) + (another long expression) ; The compiler was smart enough to know that ``optional'' semicolons don't follow operators. The real problem was that I couldn't get a good explanation of when ``optional'' semicolons would be inserted. It certainly didn't save me any work that day. Notice that I wasn't even making use of the feature. -- Gary Levin / Dept of CS / U of AZ / Tucson, AZ 85721 / (602) 621-4231