在fp里,函数没有副作用,变量都是不易变的。而在OOP中,可变状态和副作用都十分常见,甚至是被鼓励的。
In FP, functions have no side effects and variables are immutable, while in OOP, mutable state and side effects are common, even encouraged.
键并不限制为整数;它可以是任何不易变的数据类型,包括 integer、float、tuple 或 string。
The key isn't restricted to being an integer; it can be any nonmutable data type, including an integer, float, tuple, or string.
Scala通过Actors库来支持这种模式,但是它同时允许mutable(易变的)和immutable(不易变的)变量。
Scala supports this model with its Actors library, but it allows for both mutable and immutable variables.
应用推荐