一. scala 模式匹配(pattern matching) pattern matching 可以说是 scala 中十分强大的一个语言特性,当然这不是 scala 独有的,但这不妨碍它成为 scala 的语言的一大利器. scala 的 pattern matching 是类似这样的, e match { case Pattern1 => do Something case Pattern2 if-clause => do others ... } 其中,变量 e 后面接一个 match…