#scala
It makes only sense to define case classes if pattern matching is used to decompose data structures.
If you want to change selection, open document below and click on "Move attachment"
Case Classes - Scala Documentationintln("" + x1 + " == " + x2 + " => " + (x1 == x2))
println("" + x1 + " == " + y1 + " => " + (x1 == y1))
will print
Var(x) == Var(x) => true
Var(x) == Var(y) => false
<span>It makes only sense to define case classes if pattern matching is used to decompose data structures. The following object defines a pretty printer function for our lambda calculus representation:
object TermTest extends scala.App {
def printTerm(term: Term) {
term match {
c Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details