LWN.net Logo

Grokking convoluted expressions

Grokking convoluted expressions

Posted Mar 24, 2007 5:21 UTC (Sat) by RareCactus (guest, #41198)
In reply to: Grokking convoluted expressions by tjc
Parent article: Quotes of the week

Of course there's no need for -> anyway, since there's no ambiquity between struct_var.foo and pointer_var.foo -- taking the member of a pointer doesn't make sense, so there's no need for a special operator. The compiler could just take care of this for us.

It's probably too late to change. :-)

Having the language infer what you mean to do by the context is often a bad idea. If people want to dereference a pointer, they should use the dereference operator, not just silently have the language fill that in.

And yes, the syntax of function pointers is fubar in C.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds