Re:Ruby adds experimental support for rightward assignments
by actuator on Thursday September 10, 2020 @09:21PM
(#24438252)
If assignment is what we are concerned about, we should introduce something like `x := x + 1`.
[ Parent
| on HN ]
Re:Ruby adds experimental support for rightward assignments
by jghn on Thursday September 10, 2020 @09:41PM
(#24438364)
why `:=` and not `<-`?
The `<-` in R comes from the APL keyboard, and that glyph is an assignment in APL. It wasn't just some crazy invention from Ross & Robert or even John Chambers.
Re:Ruby adds experimental support for rightward assignments
by _kst_ on Thursday September 10, 2020 @10:55PM
(#24438723)
Is "x<-3" an assignment to x or a comparison of x to -3?
The same problem led early C (pre-K&R1) to change its compound assignment operators from "=op" to "op=". In early C, "x = -3" assigned the value -3 to x (as it does now), but "x=-3" meant "x = x - 3" (now written "x-=3").