Aliases for packages
First paragraph look like very useful feature for developers how like write functional code.
For example, in big program clash on function signatures it’s very possible event.
In Clojure it solved by namespaces, but in Kotlin we has nothing (see below).
Alternatives:
- “Object/Component object” - restrice to hold all functions in one file and have bad syntax
- Hack with annotaion (see code) - even more strage syntax and not supports on JS/Native
@file:JvmName("Func")
fun's ....
//usage
typealias f = Func
f.fun1
In my case it’s will be the best to write something like:
import org.app.domain as d
import org.app.presenter as p
fun main (args: Array<String>) {
d.func1()
d.func2()
p.func1()
p.func2()
}
