Closed stugol closed 8 years ago
Further:
type MyNewArray:
constructor (*args) ->
...
'literal [: :] -- define a literal constructor
say [: 1, 2, 3 :] -- same as MyNewArray(1, 2, 3)
I've been down this line back in the days. It's akin to Agda, or to the extreme: Katahdin (Ok, more common languages have them too, but these were some sources of inspiration when I was dabbling with it). Well, let's say, I have an open mind to user-defined operators, but I personally won't get my fingers dirty in that pot any time soon ;-) PR's are welcome.
I'm closing this. If a PR comes in, it's on the table.
I would like to be able to define my own operators:
And why stop there?