I'm fine with putting anonymous functions outside ...
# codingconventions
e
I'm fine with putting anonymous functions outside the parentheses when passing them to a function like
filter
, but it seems strange in this situation. What do you think?
Specifically, I would change
main()
to:
Copy code
fun main() {
  Option.selectOption(listOf(
    Option("Exit") { exitProcess() },
    Option("Restart") { restart() }
  ))
}
p
IMO I prefer using callable references for stuff like this: e.g.
Option("Restart"), ::restart)
e
I agree, but I simplified the example and will need lambda (referring to free variables).