Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!bbn!drilex!dricejb From: dricejb@drilex.UUCP (Craig Jackson drilex1) Newsgroups: comp.lang.c Subject: Re: This one bit me today Message-ID: <5182@drilex.UUCP> Date: 8 Oct 89 13:28:00 GMT References: <2432@hub.UUCP> <504@oglvee.UUCP> Reply-To: dricejb@drilex.UUCP (Craig Jackson drilex1) Organization: DRI/McGraw-Hill, Lexington, MA Lines: 47 In article <504@oglvee.UUCP> norm@oglvee.UUCP (Norman Joseph) writes: >From article <2432@hub.UUCP>, by dougp@voodoo.ucsb.edu: >> -Message-Text-Follows- >> main() >> { >> int a=1,b=2,*p=&a,c; >> c=b/*p; >> } >> >> First real flaw in the C grammer I have found. A friend of mine was bit by this around 1981. I was rather amused then, both by the grot it shows in C, and the two days it took him to not find it before he came to me. >I think it's just as fair to say that the fault lies not in the Grammar >but in the Programmer (with apologies to Shakespeare). Not only would >the judicious use of white space have prevented this "flaw", but it makes >good sense for readability & maintenance. The question is not one of coding style, it is one of language ambiguity vs language style. In C, it is normally acceptable to elide whitespace between tokens. Even in the case of characters which may be one token or two, such as '+', it can be handled. There is one and only one parse for a+++b. But since /* is such a powerful token (being handled in the preprocessor, etc.) C cannot resolve this otherwise normal expression. Yes, whitespace cures it. But it is a wart that it needs curing at all. >What makes people afraid to hit the space bar? Is it sloth, or ignorance? I saw nothing that indicated that the poster was afraid to hit the space bar. Just that he had not done so *in this instance*. Can you truthfully say that you have placed at least one space in each place where one was allowed in every C program you have written? I haven't; the necessity of doing so makes languages like SNOBOL4 annoying. >-- >Norm Joseph - Oglevee Computer System, Inc. > UUCP: ...!{pitt,cgh}!amanue!oglvee!norm -- Craig Jackson dricejb@drilex.dri.mgh.com {bbn,ll-xn,axiom,redsox,atexnet,ka3ovk}!drilex!{dricej,dricejb}