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.
"hello"
.chars
.size
.*(10980643.4)
.to_i
.to_s(36)
.upcase
=> final_value
puts(final_value)
# => WORLDIt feels a bit like a new method definition syntax that allows you to put the name after the `end` for... reasons.
x = x + 1 // assign x to x+1It's not the same language, so why should he expect the semantics to be the same?
It's a bit like discovering that inline C in your favourite non-C language isn't actually semantically correct C. If you're a mathematician, then you know, intimately and fluently, how math is spoken and written, so seeing something that looks exactly like "inline math", but isn't, is jarring.
(I don't get angry over it, but it is exactly counter to the extremely delicate and precise way mathematicians train ourselves to think about '='.)
And I don't see why a statement can't describe a mutation.
set age 42
`favorite_color = red' == "Favorite Color is Red"
Which feels more natural than: "Red is Favorite Color"
Is this true (the 'unnatural' part)? Reading left to right, `age = 42` can be read as "age is 42" which feels perfectly natural in English. `42 => age` would be read as "assign 42 to age"? This feels more awkward to me. I'm not sure I understand why anyone would want Rightward assignment.