The api has FunctionN(0-22) ProductN(1-22) TupleN(1-22)
the question is:
1.why the number is end of 22? why not 21 or 23?
2.why Function is start with 0 ? but Product and Tuple are not?
The api has FunctionN(0-22) ProductN(1-22) TupleN(1-22) the question is: 1.why the number is end
Share
It does not make sense to have a
Productor aTuplethat contains no elements. These would be equivalent toUnit.Function0exists because a function does not necessarily take arguments (e.g. in the case of by-name arguments).In the case of
Tuple22andFunction22I cannot tell why the Scala team chose 22 as a maximum but it definitely is awkward to have tuples with that many members or functions that take more than 22 arguments.It could be though that there is a restriction on how many arguments to a method the JVM can handle.