There doesn't seem to be much support for supporting custom operators (see #818) in Rust. But what about calling normal binary functions as if they were operators, like haskell allows you to?
The syntax would be:
to convey scalar product of two vectors a and b.
Another option suggested by @bluss:
Or if it possible without parsing conflicts (@thepowersgang: "but probably not dersirable"):
Which is converted to
or, depending on the function:
There doesn't seem to be much support for supporting custom operators (see #818) in Rust. But what about calling normal binary functions as if they were operators, like haskell allows you to?
The syntax would be:
a `dot` bto convey scalar product of two vectors a and b.
Another option suggested by @bluss:
Or if it possible without parsing conflicts (@thepowersgang: "but probably not dersirable"):
Which is converted to
or, depending on the function: