For example:
const val MaxLength = 9 //Example number
fun Add (x : Int, private pos: Int = MaxLength) {...}
would work exactly like:
const val MaxLength = 9 //Example number
private fun Add (input: Int, pos:Int) {...}
fun Add (x : Int) = Add(input, MaxLength)
I could have written it as: fun Add (input: Int, pos: Int = MaxLength)
, but then I expose my pos
parameter.
Visibility modifiers on default parameters would work similarly to how visibility modifiers work on properties with custom getters/setters: Default parameter visibility must be the same or less permissive than function visibility.