with

abstract fun <R> with(lambda: Scope.() -> R): R

Runs lambda with this Scope as its receiver, returning whatever lambda produces. This is the idiomatic way of using a Scope: Scope.empty().with { ruleOf(...) }, or more concisely Scope.empty { ruleOf(...) } via the companion overloads.