so, I get that kotlins closure stuff makes it neat...
# announcements
g
so, I get that kotlins closure stuff makes it neat and idomatic to create object trees with kotlin, is there a clever syntax to create graphs (DAGs)? maybe something along the lines of overloads, one with a context-free-reciever lamba, and another with a single-'root'-argument lambda
Copy code
//nifty syntax to create tree
something() {
  a = b
  somethingElse = cool(){
    //...
  }
  orMaybeExtensionMethod(){
    //...
  }
}
such that if you create an object in the
cool
function, and wanted a reference to it from the
orMaybeExtensionMethod
, we could overload it to...
Copy code
//nifty syntax to create tree
something() {
  a = b
  somethingElse = cool(){
    importantValue = Important()
  }
  orMaybeExtensionMethod(){ root ->
    refEqualsImportantvalue = root.somethingElse.importantValue
  }
}