Env

object Env

The environment for method parameters

For performance and usability, we restrict parameters to be either Cold or Hot.

Despite that we have environment for evaluating expressions in secondary constructors, we don't need to put environment as the cache key. The reason is that constructor parameters are determined by the value of this --- it suffices to make the value of this as part of the cache key.

This crucially depends on the fact that in the initialization process there can be exactly one call to a specific constructor for a given receiver. However, once we relax the design to allow non-hot values to methods and functions, we have to put the environment as part of the cache key. The reason is that given the same receiver, a method or function may be called with different arguments -- they are not decided by the receiver anymore.

class Object
trait Matchable
class Any
Env.type

Type members

Types

opaque type Env

Value members

Concrete methods

def apply(bindings: Map[Symbol, Value]): Env
def apply(ddef: DefDef, args: List[Value])(using Context): Env

Concrete fields

val empty: Env

Extensions

Extensions

extension (env: Env)
def getOrElse(sym: Symbol, default: Value)(using Context): Value
def lookup(sym: Symbol)(using Context): Value
def union(other: Env): Env