You didn’t know that Python can actually have custom infix operators, like vector1 |cross_product| vector2
, did you? From where I’m sitting, I can see C++ turning green with envy. :) Of course, this is a hack, but it’s actually not so horrible that it wouldn’t be usable in day-to-day code. The operators obey module/package qualifications, too.
How neat is that? :jawdrop:
Update: Very little actual thinking reveals that the same thing is possible in C++ as well. It remains as a last consolation that pulling it off takes about three times as much effort as in Python. :)