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)

    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 (1822–1893)