Re:Scala: Where it came from, Where it's going
by azth on Tuesday March 17, 2015 @04:10PM
(#9221019)
I'm assuming it's to unify the `apply()` operation between collections (maps, sequences, arrays, etc). The collection library derives from a trait hierarchy, and an array is one of these collection types.
[ Parent
| on HN ]
Re:Scala: Where it came from, Where it's going
by acjohnson55 on Wednesday March 18, 2015 @01:09AM
(#9223737)
Not just between collections, but functions as a whole. An indexed sequenced is essentially a mapping (read: function) from the integers to whatever the element type is. Scala makes that explicit, rather than creating another mapping operator, as though they failed to notice the symmetry.
I would characterize this sort of thinking as one of the core principles of the language design. The designers search for underlying generality and bring it to the surface of the language. This can be a little frustrating at times, since humans aren't necessarily geared toward abstraction. But investment in understanding the abstractions pays off again and again.