3 ms·
a = f(e(d(c(b))), 4), 5) That has 4 opening parenthesis and 5 closing parenthesis. b is passed to c b ~> c then the result is passed to d
by mg 3y ago
a = f(e(d(c(b))), 4), 5)
That has 4 opening parenthesis and 5 closing parenthesis.
b is passed to c
b ~> c
then the result is passed to d
b ~> c ~> d
then to e along with 4 as a second parameter
b ~> c ~> d,4 ~> e
and finally to f along with 5
b ~> c ~> d,4 ~> e,5 ~> f
- notpushkin 3y agob ~> c ~> d,4 ~> e This reads as b ~> c ~> (d, 4) ~> e to me. Sure, you can get used to it, but it’s pretty unnatural. Is this syntax used in any other languages?
- mg 3y agoThe nice aspect of "this ~> that" is that the meaning is simply "put this into that". And that it results in the shortest code. An alternative would be: b ~> c ~> d ~> e(%,4) Slightly longer, but maybe easier to read. Also easier to handle, as you can remove the fourth part " ~> e(%,4)" without having to change the third part.