我试图理解ListScala 中s 的实现.特别是我试图了解如何使用中缀运算符编写匹配表达式,例如:
a match {
case Nil => "An empty list"
case x :: Nil => "A list without a tail"
case x :: xs => "A list with a tail"
}
Run Code Online (Sandbox Code Playgroud)
如何允许匹配表达式x :: xs而不是List(x, xs)?