Kotlin for C# Developers

5.1. DSL overview

The code snippet on the previous page…

html {
    body {
        div("hello world")
    }
}

…is an example of a domain-specific language or DSL, also referred to as type-safe builder syntax. It combines a few Kotlin features:

Let’s look at each in turn to build an understanding of that strange DSL syntax.

Next: Defining lambdas