4 ms·
Why are Scala's "=" function definitions questionable? It makes absolute sense since a function should return a value.
by Cyph0n 9y ago
Why are Scala's "=" function definitions questionable? It makes absolute sense since a function should return a value.
- joshlemer 9y agoThey might be referring to the update methods: val array = new Array[String](10) array.update(7, "hello") array(7) = "hello" // simply calls out to update
- smitherfield 9y agoFor the same reason omitting braces in C-style-syntax conditionals and loops is questionable, i.e. misleading indentation. As a bit of an unreformed code golfer and a fan of ML-style syntax, I actually kinda like it myself; I was just listing a few things that are "considered questionable" (by some people) and present in both languages.