Scala

Scala Notes: Pattern Matching

Pattern matching lets you automatically execute code based on some piece of data. Scala uses pattern matching often, such as when you parse XML or pass messages between threads. Basic syntax of pattern

Gist: Scala Set

In Scala, an instance of Set can be declared as follows. val s = (1 to 6).toSet Principle difference between sets and sequences are three: * Sets are unordered val s = (1 to 6)