相关疑难解决方法(0)

scala tuple拆包

我知道这个问题以不同的方式出现过很多次.但我现在还不清楚.有没有办法实现以下目标.

def foo(a:Int, b:Int) = {}

foo(a,b) //right way to invoke foo

foo(getParams) // is there a way to get this working without explicitly unpacking the tuple??

def getParams = {
   //Some calculations
   (a,b)  //where a & b are Int
}
Run Code Online (Sandbox Code Playgroud)

parameters scala tuples

90
推荐指数
3
解决办法
3万
查看次数

标签 统计

parameters ×1

scala ×1

tuples ×1