The compiler doesn't do common subexpression elimination, so the indexings are repeated. If performance is very important one has to do something like this:
mixed tmp; if ((tmp = a->foo) && (tmp = tmp->bar) && (tmp = tmp->fie)) ...
I too see some advantage with an ~> operator, but I still don't think it's really worth extending the operator set for such a special case. We already got three indexing operators, and that's often one too much.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-29 09:42: Subject: zero_type();
Well, as long as the compiler eliminates CSEs from the expression
a && a->foo && a->foo->bar && a->foo->bar->fie
I'd be quite happy anyway. Is that true, or does it have to be conservative regarding `->() in each dereferencing step? If so I'd see a performance advantage in a new operator.
/ Jonas Walldén