On Github andypetrella / Scala-For-Rubyists
or:
Every thing is an object...
Polymorphism is, of course, encouraged.
But several options are possible.
Every thing can be a function (λ-calculus).
Possible, but not mandatory.
OTOH, immutability is more than encouraged!
Forget about statements and embrass expressions.
Describe what to do, not how to do.
Strongly types means:
allowing interesting stuffs with type
So Scala does...
It's not Java, neither C++
A type can describe
`case class` creates immutable objects
Based on the type, the compiler generates `copy`
Describe what you want to do ...
... and choose how/when to execute it
Some functionnalities can be dependent of the context
The code can adapt to the context
Old code is not touched: Horizontal extension
Pass a by-name parameter to a function...
... its evaluation will be delayed at its first access
Declare a computation...
Doens't wait for the result
But react on it...
Classes can be pimped with new methods...
... contextually
It's up to the dev's choice!
Do it as less often as possible...