Companion

object Companion

Factory functions for creating Scopes.

Functions

Link copied to clipboard

Creates a new, empty Scope, with no Variables cached yet.

fun <R> empty(lambda: Scope.() -> R): R

Shorthand for empty().with(lambda). See with.

Link copied to clipboard
fun of(variabled: Variabled): Scope

Creates a new Scope, pre-populated with the variabled's Variabled.variables.

Creates a new Scope, pre-populated with the given vars, indexed by their Var.name.

fun of(vararg vars: String): Scope

Creates a new Scope, pre-populated with fresh variables named after vars.

fun of(var: Var, vararg vars: Var): Scope

Creates a new Scope, pre-populated with the given Vars, indexed by their Var.name.

fun <R> of(vars: Variabled, lambda: Scope.() -> R): R
fun <R> of(vars: Iterable<Var>, lambda: Scope.() -> R): R
fun <R> of(vars: Sequence<Var>, lambda: Scope.() -> R): R

Shorthand for of(vars).with(lambda). See with.

fun <R> of(vararg vars: String, lambda: Scope.() -> R): R

Shorthand for of(*vars).with(lambda). See with.

fun <R> of(var: Var, vararg vars: Var, lambda: Scope.() -> R): R

Shorthand for of(var, *vars).with(lambda). See with.