3 ms·
By ambiguous, I mean that operator|'s precedence is very different than operator.'s (std::operator<< has similar issues); which could lead to surprises if you d
by byuu 12y ago
By ambiguous, I mean that operator|'s precedence is very different than operator.'s (std::operator<< has similar issues); which could lead to surprises if you don't have the precedence tables memorized.
operator. is at the optimal precedence for method chaining, and has well understood behavior, so I think it'd be preferred over hijacking things like the bitwise-or operator.
- paxcoder 12y agoHeh, didn't even notice that you mentioned ambiguity too. I was refering to the D's version with the dot operator: A programmer needs to differentiate between function calls and method calls. I wonder which ambiguity @pfultz2 was referring to. But now that you mention it, an operator (such as pipe) with a lower precedence could actually be useful and spare having to jump back in code to open brackets.