Scala (programming Language) - Features (with Reference To Java) - Functional Tendencies

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:

    In short, the building becomes a theatrical demonstration of its functional ideal. In this romanticism, High-Tech architecture is, of course, no different in spirit—if totally different in form—from all the romantic architecture of the past.
    Dan Cruickshank (b. 1949)

    Hence it will not do for the Landlord to possess too fine a nature.... He must have no idiosyncracies, no particular bents or tendencies to this or that, but a general, uniform, and healthy development, such as his portly person indicates, offering himself equally on all sides to men.
    Henry David Thoreau (1817–1862)