For the last week or two I’ve been packing a few boxes every night as I prepare for a move a few miles to the north. Last night I started packing the old Beginning Scala book, when I noticed a bookmark I had in it. When I flipped to the bookmark, I found code like this:
trait Shape case class Circle(radius: Double) extends Shape case class Square(length: Double) extends Shape case class Rectangle(h: Double, w: Double) extends Shape
which was later followed by code like this: