Re:Ruby adds experimental support for Rightward assignments
by lioeters on Friday September 04, 2020 @03:59PM
(#24378377)
I considered such an assignment operator for a little language I was developing, but there was an ambiguity between this:
a <- 25
and this: a < -25
Since everything was an expression in the language, the latter would evaluate to a boolean. In the end I just went with "=" for assignment, and "==" for equality.
Probably because adding a colon to an equality sign doesn’t clarify the meaning at all.
Had Algol (as some less widely influential for other reasons languages have) adopted something that more clearly represented movement into the variable being assigned like:
Maybe it would have won out over “=" for assignment.