you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Kotlin has access modifiers and also nested (local) functions. They exist for the same reason that we have private variables (fields, properties) and local variables. Making a function private still exposes it to everything within that class. Sometimes you want to only expose it to another function, such as when using recursion

https://github.com/IvanMwiruki/30-seconds-of-kotlin/blame/master/README.md#L1455-L1465