I am reading a great book Programming in Scala by Martin Odersky (creator of Scala) and others.
There comes up the chapter 9.3 Currying
where currying is introduced. This leads me to the question, is there some limit to the number of parameter lists a Scala 3 function can have? Follow-up question: if there is/n't a limit, why?
For example, the following Scala 3 snippet compiles just fine.
There is a function curriedSum
with 5 parameter lists (it is only for illustration, every sane programmer would use a single parameter list).
def curriedSum(a: Int)(b: Int)(c: Int)(d: Int)(e: Int) = a + b + c + d + e
curriedSum(1)(2)(3)(4)(5) // 15
version without currying
def ordinarySum(a: Int, b: Int, c: Int, d: Int, e: Int) = a + b + c + d + e
ordinarySum(1, 2, 3, 4, 5) // 15