scala.quoted.staging

Members list

Type members

Classlikes

trait Compiler

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Compiler

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Compiler.type

Value members

Concrete methods

def run[T](expr: Quotes ?=> Expr[T])(using compiler: Compiler): T

Evaluate the contents of this expression and return the result. It provides a new Quotes that is only valid within the scope the argument.

Evaluate the contents of this expression and return the result. It provides a new Quotes that is only valid within the scope the argument.

Usage:

val e: T = run { // (quotes: Quotes) ?=>
  expr
}

where expr: Expr[T]

This method should not be called in a context where there is already has a Quotes such as within a run or a withQuotes.

Attributes

def withQuotes[T](thunk: Quotes ?=> T)(using compiler: Compiler): T

Provide a new quote context within the scope of the argument that is only valid within the scope the argument. Return the result of the argument.

Provide a new quote context within the scope of the argument that is only valid within the scope the argument. Return the result of the argument.

Usage:

val e: T = withQuotes { // (quotes: Quotes) ?=>
  thunk
}

where thunk: T

This method should not be called in a context where there is already has a Quotes such as within a run or a withQuotes.

Attributes