Re:Ruby adds experimental support for rightward assignments
by keeganpoppen on Thursday September 10, 2020 @10:49PM
(#24438698)
wait i feel like that's actually kind of gorgeous. syntax highlighting as it exists today might not be good enough to really make that form stand out, though...
Re:Ruby adds experimental support for rightward assignments
by Freaky on Thursday September 10, 2020 @08:30PM
(#24438033)
... and it's useful how? It obscures the assignment at the end of an arbitrarily long statement instead of giving the value a name right up front.
It feels a bit like a new method definition syntax that allows you to put the name after the `end` for... reasons.
Below is an _incredibly_ contrived example. Take note how the `=> final_value` syntax is useful. The alternative is to place a `final_value = ` at the _top_ of the statement. I'll admit: placing the assignment at the top of the method chain helps point out to the reader of the code that an assignment is happening. However, more useful I think is quickly recognizing the flow of data.