Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!adobe!hawley From: hawley@adobe.COM (Steve Hawley) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C Suggestions Message-ID: <7154@adobe.UUCP> Date: 9 Oct 90 17:14:51 GMT References: <20912@well.sf.ca.us> <1990Oct7.232419.20984@ida.liu.se> <1990Oct8.154744.15837@nntp-server.caltech.edu> <1990Oct9.020415.16763@eng.umd.edu> Reply-To: hawley@adobe.UUCP (Steve Hawley) Organization: Adobe Systems Incorporated, Mountain View Lines: 45 In article <1990Oct9.020415.16763@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes: >In article <1990Oct8.154744.15837@nntp-server.caltech.edu> palmer@nntp-server.caltech.edu (David Palmer) writes: >>Here's a suggestion for the next 'Think C'. Allow the operator '->>' to >>dereference handles, just as '->' dereferences pointers. ... >>(The reason why '->>' should be used instead of '-->' is because it >>shows up better, and it would not be parsed as a post-decrement >>greater-than combination.) >No, instead as minus shift right. You can't win. If you make a smart >compiler, you can recognize handles to structs and add the extra de-reference >automagically-- I'd like to see that (in both THINK and MPW.) Why can't you win? Is -> interpretted as "negative greater than"? Nope. So why should ->> cause any problems? It should be recogized correctly by the tokenizer in the scanner. This why you can write expressions like: --a---=--a-----a--; and know that it will be interpretted as: --a-- -= --a-- - --a--; Since the scanner matches the largest token. Something gross, like: a-->>=4; Would be tokenized as a-- >>= 4; If you offer the token ->> shouldn't you also offer the tokens ->>> and ->>>> and ->>>>> and ->>>>>> and ->>>>>>> etc? I thought that's what you got from (*******foo).bar... Your parser just gets ugly (uglier?). I, personally, am not for it. Is there any significant win in the coding? Admittedly, the Mac uses handles fairly frequently, but I can't see what sort of win you'd be getting from it in the code generation (especially in Think C which has no real optimizing pass). Steve Hawley hawley@adobe.com -- "I'm sick and tired of being told that ordinary decent people are fed up with being sick and tired. I know I'm certainly not, and I'm sick and tired of begin told that I am." -Monty Python