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:

    Well designed, fully functional infant. Provides someone to live for as well as another mouth to feed. Produces cooing, gurgling and other adorable sounds. May cause similar behavior in nearby adults. Cries when hungry, sleepy or just because. Hand Wash with warm water and mild soap, then pat dry with soft cloth and talc. Internal mechanisms are self-cleaning... Two Genders: Male. Female. Five Colors: White. Black. Yellow. Red. Camouflage.
    Alfred Gingold, U.S. humorist. Items From Our Catalogue, “Baby,” Avon Books (1982)

    The tendencies of the times favor the idea of self-government, and leave the individual, for all code, to the rewards and penalties of his own constitution, which work with more energy than we believe, whilst we depend on artificial restraints.
    Ralph Waldo Emerson (1803–1882)