-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
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` b
to convey scalar product of two vectors a and b.
Another option suggested by @bluss:
a \dot b
Or if it possible without parsing conflicts (@thepowersgang: "but probably not dersirable"):
a dot b
Which is converted to
a.dot( b )
or, depending on the function:
dot( a, b )
bluss, amodv, oli-obk, bungcip, codyps and 48 moreticki, Ms2ger, twmb, noprompt, apasel422 and 20 moredemurgos, H2CO3, tesuji, stepancheg, mn-dex and 1 more
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.