Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!mcdchg!laidbak!tellab5!mtcchi!fjo From: fjo@mtcchi.uucp (2667-Frank Owen(ZG90210)0000) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C Suggestions Message-ID: <1990Oct11.221423.19815@mtcchi.uucp> Date: 11 Oct 90 22:14:23 GMT References: <1990Oct9.171921.29529@mtcchi.uucp> <1990Oct10.054054.25762@d.cs.okstate.edu> Organization: Memorex Telex Corporation NSBG/STP Lines: 51 minich@d.cs.okstate.edu (Robert Minich) writes: >Your argument (except for supporting a standard) is completely bunk. If >nothing is so hard about > (*p)->x >then why not > (*p).x instead of p->x >??? What's so hard about THIS? Personally, I tend to end up with a ton a >parenthesis and adding a couple more often makes it harder to understand >but that's C for you. Make's me want to go back to Pascal at times (no >often, though) > (*object_ptr)->object_field > (*((Handle *)(&(myPtr))))->field >is equivalent to > object_ptr^^.object_field > Handle(@myPtr)^^field >Of course the second part is rather dumb. Yes, it is. Using your examples, the "improved" syntax would yield: object_ptr->>object_field ((Handle *)(&(myPtr)))->>field I don't find this THAT much better. >Now add a couple more typecasts in there and try your luck at figuring >out you forgot a dereference and the C compiler didn't mind a bit. :-) Actually, the C compiler usually DOES mind if you forget a dereference. If you say (object_ptr)->object_field, you will get a compile error, as object_field is not a member of what object_ptr points to. O.K. I'll admit that sometimes it's a bit more difficult in C, but unless there is a language feature missing (like those added with C++), I think it's a bit late to be changing the language. -- Frank Owen (fjo@mtcchi.uucp) 708-305-3182 Memorex-Telex Corporation Indian Hill Court 1000 E. Warrenville Rd. RM 1A315 Naperville, Il 60563