我有这样一段代码从this question:在Scala中`:_ *`(冒号下划线明星)是做什么的?
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连接,然后呢? : _*
做什么?
非常感谢您为标题添加(冒号下划线明星)! – Gal 2014-09-02 18:29:16