Open yggdr opened 1 year ago
You can always do
operator ~~
(~~) = (,)
x = 1
x |>= (. ~~ 2)
assert x == (1, 2)
which even compiles down to remove the partial and give you the exact code you'd want for an in-place operator:
_coconut_op_U7e_U7e = (_coconut_comma_op)
x = 1
x = (_coconut_op_U7e_U7e)(x, 2)
assert x == (1, 2)
Hello, I am going to try and do that.
Currently we have the possibility to create our own custom operators like so:
but we don't seem to have a possibility to create in-place versions. I propose an additional language-construct like
that takes an already defined operator
~~
(like above) and creates new functionality allowingleft ~~= right
to be syntactic sugar forleft = left ~~ right
.