Grokking convoluted expressions
Posted Mar 24, 2007 5:21 UTC (Sat) by RareCactus
In reply to: Grokking convoluted expressions
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.
to post comments)