2
鑑於實例Tuple2
形式斯卡拉元組提取
type Duple = (String,Int)
此功能犯錯提取並在參數標註二倍的項目,
def f((s,n): Duple): String = s*n
但是這個作品,
def f(d: Duple): String = {
val (s,n) = d
s*n
}
是否有一個簡短的形式來提取和標記元組的項目一個函數比這個聲明式的方法?