How does this work (lambda after the `String`): ``...
# tornadofx
h
How does this work (lambda after the
String
):
Copy code
range {
    "age" {
        from = 10
        to = 20
    }
}
That "age" block is somehow creating a
RangeBlock.RangeData
instance.
Ah
RangeBlock.RangeData
provides an extension function on `String`:
Copy code
operator fun String.invoke(init: RangeData.() -> Unit): RangeData {
        return RangeData(name = this).apply(init)
    }
That's a kinda nifty.