- What does DSL stand for?
- Can you name two examples of domains to which DSLs can be applied?
- Building web pages
- Defining static layouts
- Testing
- What are the two primary building blocks of a DSL in Kotlin?
- Extension functions
- Higher-order functions
- What are two mechanisms for controlling the scope of a DSL function?
- Functions with a receiver
- @DslMarker annotations
- What is the @DslMarker annotation used for?
- It controls which receivers a lambda has access to by default so that a lambda only has access to the current receiver if annotated.
- What are two benefits that custom DSLs can provide?
- They provide a very human-readable API for common tasks.
- They can simplify the construction or representation of an artifact (such as a web page) using the declarative syntax of a DSL