I am translating some code from the lets-plot Kotlin API from here. From the docs, I have a grasp of the class constructor invocation, but I have not found anything about the implicit passing of a closure after the constructor is called. The authors use this idiom a lot for plot configuration:
geomDensity(color = "dark-green",
fill = "green",
alpha = .3,
size = 2.0) { x = "x" }
The example uses it for defining geom instances (of which there is a final argument that is a function of a mapping type to unity, what from inspecting so