Why don't property setters use lambda syntax? I im...
# language-evolution
h
Why don't property setters use lambda syntax? I imagine it was considered and decided against:
Copy code
var foo = 6
    set {
        println("setting foo to $it")
        field = it
    }
Copy code
var foo = 6
    set { num ->
        println("this is maybe more tedious")
        field = num
    }
🤔 3
👀 1
r
My guess is that it encourages nameless parameters in a potentially public property but your proposed syntax looks really nice 🙂
e
Now you should ask the same question about functions, shoudn't you?