12
Let's say I have such class hierarchy:
abstract class Expr
case class Var(name: String) extends Expr
case class ExpList(listExp: List[Expr]) extends Expr
Would it be better to define constructor of ExpList like this:
case class ExpList(listExp: Expr*) extends Expr
I would like to know, what are drawbacks/benefits of each definitions regards pattern matching?