3 ms·
I'd really like to see user-defined infix operators such as those in Haskell. There are some baked into the standard library (*+-/ etc), but you can also roll y
by gamegoblin 13y ago
I'd really like to see user-defined infix operators such as those in Haskell. There are some baked into the standard library (*+-/ etc), but you can also roll your own, so people could make do until this gets accepted.
- maxerickson 13y agoYou can get cute about it: http://code.activestate.com/recipes/384122-infix-operators/ http://code.activestate.com/recipes/384122-infix-operators/ The code there overrides | to construct arbitrary operators that are used by wrapping an object in |, like: a |x| b where x defines the custom behavior.