|
|
|
|
|
by sjrd
239 days ago
|
|
In Scala you can do it, because you can define your own operators (which are nothing but method names), and you can extend types you don't control. You are a bit constrained by the operator precedence rules, but it's usually good enough. It's bad practice to make DSLs left and right, obviously. But when one is warranted, you can. For example here you could have "x" --> "y" | "hello world"
|
|