Skip to content

Instantly share code, notes, and snippets.

Last active Jan 3, 2018
What would you like to do?
val fileContents by FileLoaderDelegate("someFile.txt")
class FileLoaderDelegate(private val filename: String) {
operator fun getValue(thisRef: Any?, property: KProperty<*>): Any {
return readFile(filename)
fun main(args: Array<String>) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment