Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site drux3.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!mtuxo!drutx!drux3!pcf From: pcf@drux3.UUCP (FryPC) Newsgroups: net.lang.c Subject: Re: "C" wish list/semicolons Message-ID: <1367@drux3.UUCP> Date: Thu, 7-Nov-85 11:59:45 EST Article-I.D.: drux3.1367 Posted: Thu Nov 7 11:59:45 1985 Date-Received: Fri, 8-Nov-85 07:44:58 EST References: <335@graffiti.UUCP> <895@rlvd.UUCP> <742@mmintl.UUCP> <6107@utzoo.UUCP> <142@ucbjade.BERKELEY.EDU> Organization: AT&T Information Systems Laboratories, Denver Lines: 34 Keywords: language design C semicolons argh > Let (semicolons) them separate two staments on the same line. Let line breaks > terminate statements if it makes sense to do so. > ... > Since modern languages like CLU, Icon and BCPL (BCPL! Waitaminute!) allow > this, I think it belongs on any C wish list. > ... > P.S. No, I don't know why this disappeared between BCPL and C (at which > step?). Anyone care to explain? The problem is that C overloads operators, in particular "*"; as "*" can leagally start (indirection) or legally continue (multiplication) a statement. Combined with the fact that assignments have a value, the following fragment could be parsed in (at least) two ways. x = a * b /* x = a * b * (c = 1); */ *c = 1 /* or x = a * b; *c = 1; */ A solution is to make "*" (indirection) a postfix operator. This would also make declarators using pointers easier, as all modifiers would be postfix and parentheses would not be required for grouping. You could read off everything left to right. Example: A function returning a pointer to a function returning an integer: int (*func(args))() becomes int func(args)*() And that is one thing on my 'I wish they had done it this way' list. Peter Fry drux3!pcf "Oh Bullshot, you are wonderful." "No, not wonderful, just British."