look at the signature for `with`<p><pre><code>    inline fun &lt;T, R&gt; with(receiver: T, f: T.() -&gt; R): R 
</code></pre>
it takes a lambda that is scoped to the receiver type `T`. This means the lambda runs in the scope of whatever is passed in as a receiver.<p><pre><code>    with(list) {
      add(item)
      add(item)
    }
</code></pre>
This essentially lets you create DSLs for whatever.<p>Another thing that&#x27;s bit me in butt recently is that `Protocol`s aren&#x27;t concrete types, unlike an `interface` in Java&#x2F;Kotlin.