Type inference help ease the static type verbosity.
Dynamic type language binds type to value, not variable, so type change with value change.
Type
Variable
Value
Mixed-paradigm -- OOP + Trait. Trait is for impl class with mixin.
Everything is object, no primitive types
No static class member, instead Scala uses Singletons.
Scala supports FP with Actors library, but allows for both mutable and immutable variables. Normally FP can't have mutable states.
closures, a feature that dynamic languages like Python and Ruby have adopted from the functional programming world
"Closures are functions that reference variables from the scope enclosing the function definition. That is, the variables aren’t passed in as arguments or defined as local variables within the function. A closure "closes around" these references, so the function invocation can safely refer to the variables even when the variables have gone out of scope! Closures are such a powerful abstraction that object systems and fundamental control structures are often implemented using them."
--> In Closure the variable scope is just around the function
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment