Main methods on object classes (singletons)?


#1

Is it possible to get main methods on object classes (singletons).  Currently main methods are scoped to a package, it would be great to allow them to be on classes like Java.  We keep directories of utility apps, each with is own Main methods, and in using kotlin have found we need to put each of these classes into it own package.  


#2

There's no way to have several "main" methods in same package in Kotlin now. I've created KT-5004 with mentioning your example. The possible solution is already proposed here, but further discussion is needed.


#3

FYI: You don't need create directory for each package, because Kotlin packages is not tied up to any physical file-system entity. And a new file with a new package is enough for you case.