我有以下一段代码,来自这篇问题:
def addChild(n: Node, newChild: Node) = n match {
case Elem(prefix, label, attribs, scope, child @ _*) => Elem(prefix, label, attribs, scope, child ++ newChild : _*)
case _ => error("Can only add children to elements!")
}
除了以下这条语句: child ++ newChild : _*
,其他都很明确。
它是什么意思?
我理解其中有一个Seq[Node]
与另一个Node
串联在一起,然后呢?: _*
是什么意思?