State

case class State(objectIndex: Int, valIndex: Int, imports: Map[Int, List[Import]], invalidObjectIndexes: Set[Int], context: Context)

The state of the REPL contains necessary bindings instead of having to have mutation

The compiler in the REPL needs to do some wrapping in order to compile valid code. This wrapping occurs when a single MemberDef that cannot be top-level needs to be compiled. In order to do this, we need some unique identifier for each of these wrappers. That identifier is objectIndex.

Free expressions such as 1 + 1 needs to have an assignment in order to be of use. These expressions are therefore given a identifier on the format resX where X starts at 0 and each new expression that needs an identifier is given the increment of the old identifier. This identifier is valIndex.

Value parameters:
context

the latest compiler context

imports

a map from object index to the list of user defined imports

invalidObjectIndexes

the set of object indexes that failed to initialize

objectIndex

the index of the next wrapper

valIndex

the index of next value binding for free expressions

trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

Inherited methods

Inherited from:
Product