https://kotlinlang.org logo
#functional
Title
# functional
w

wakingrufus

01/25/2022, 10:24 PM
what was the reason that the arity of function types maxed out at 22 originally? (before FunctionN). is there something special about 22 or was it arbitrary?
e

ephemient

01/25/2022, 10:32 PM
as far as I know, it's arbitrary, but curious. Scala also tops out at Function22/Tuple22/Product22, with a similar array-based type-erased workaround for larger arities as Kotlin's FunctionN
w

wakingrufus

01/28/2022, 6:04 PM
yeah similarities between scala and kotlin there is what made me wonder
and all the KEEPs and such for functionN don't mention WHY the limit was 22
e

elizarov

02/09/2022, 8:44 AM
It's arbitrary. Kotlin just picked the number from Scala. Why Scala tops at 22 I don't know.
13 Views