https://kotlinlang.org logo
#ktor
Title
w

warriorprincess

03/07/2018, 4:12 PM
is a closure being passed to the 'install' function?
The main idea is that when a the last parameter of a kotlin function is a callback/lambda/closure, you can put curly brackets outside
Copy code
install(Routing, {
  get("/") {
    call.respondText("Hello, World!")
  }
})
👍 1
It is equivalent to this, but with a cleaner syntax, since you don’t have to put the
)
after the
}
and do not have a
,
at all.
w

warriorprincess

03/07/2018, 4:18 PM
That clarifies it perfectly. Thanks a lot!
👍 1