Functional Tendencies
While supporting all of the object-oriented features available in Java (and in fact, augmenting them in various ways), Scala also provides a large number of capabilities that are normally found only in functional programming languages. Together, these features allow Scala programs to be written in an almost completely functional style, and also allow functional and object-oriented styles to be mixed.
Examples are:
- No distinction between statements and expressions
- Type inference
- Anonymous functions with capturing semantics (i.e. closures)
- Immutable variables and objects
- Lazy evaluation
- Delimited continuations (since 2.8)
- higher-order functions
- nested functions
- currying
- pattern matching
- algebraic data types (through "case classes")
- tuples
Read more about this topic: Scala (programming Language), Features (with Reference To Java)
Famous quotes containing the words functional and/or tendencies:
“Stay-at-home mothers, . . . their self-esteem constantly assaulted, . . . are ever more fervently concerned that their offspring turn out better so they wont have to stoop to say I told you so. Working mothers, . . . their self-esteem corroded by guilt, . . . are praying their kids turn out functional so they can stop being defensive and apologetic and instead assert See? I did do it all.”
—Melinda M. Marshall (20th century)
“The general review of the past tends to satisfy me with my political life. No man, I suppose, ever came up to his ideal. The first half [of] my political life was first to resist the increase of slavery and secondly to destroy it.... The second half of my political life has been to rebuild, and to get rid of the despotic and corrupting tendencies and the animosities of the war, and other legacies of slavery.”
—Rutherford Birchard Hayes (18221893)