given e.g:
scala> def pipes(strings:String*) = strings.toList.mkString("|")
which I can call normally:
scala> pipes("foo", "bar")
res1: String = foo|bar
or with a splat:
scala> val args = List("a","b","c")
scala> pipes(args:_*)
res2: String = a|b|c
But can I use a splat to provide arguments for anything but a varargs parameter? e.g I would like to do something like:
scala> def pipeItAfterIncrementing(i:Int, s:String) = (i + 1) + "|" + s
scala> val args:Tuple2[Int, String] = (1, "two")
scala> pipeItAfterIncrementing(args:_*)
That doesn't work, but is there any way to achieve the same effect of providing multiple arguments from a single object, whether it be a tuple or something else? Is there any reason this couldn't be implemented for tuples, given that both their length and types are known at compile-time?