Re:Ruby adds experimental support for Rightward assignments
by mathw on Friday September 04, 2020 @03:46AM
(#24372698)
I get why you'd want it, but I'm not sure they should be reusing => for it, since that already means something in Ruby.
[ Parent
| on HN ]
Re:Ruby adds experimental support for Rightward assignments
by arnvald on Friday September 04, 2020 @08:37AM
(#24374369)
Yeah, I also start getting confused by reusing of the syntax. Now there's also a proposal to use { 1, 2, 3 } to represent sets - but {} is already used for blocks of code and for maps, so now that will be essentially a 3rd use case for curly braces.
On the other hand Ruby has already such a extensive syntax that it's hard to come up with something else that would not already be taken. -> represents lambda, >> is a valid method name, etc.