|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elang.scope.Scope | +--org.erights.e.elang.scope.OuterScope
Untamed:
Field Summary | |
private boolean |
myIsMutable
|
private int |
myNextOuter
|
private String |
myOptFQNPrefix
|
private Slot[] |
myOuters
|
Fields inherited from class org.erights.e.elang.scope.Scope |
myScopeMap |
Constructor Summary | |
private |
OuterScope(ScopeMap map,
Slot[] outers,
int nextOuter,
boolean isMutable,
String optFQNPrefix)
|
Method Summary | |
void |
bindOuter(String name,
Slot slot)
Enabled: |
void |
cleanup()
Enabled: If a top-level definition is aborted, it can leave behind a slot that was reserved but never bound to anything. |
Scope |
diverge(String fqnPrefix)
Enabled: Return a new non-mutable OuterScope that does not share outers data structures with the receiver. |
(package private) Slot |
getCurrentAtIndex(int index)
|
Slot |
getIndex(int index)
Enabled: |
String |
getOptFQNPrefix()
Enabled: |
Slot |
getSlot(String name)
Enabled: |
(package private) void |
initIndex(int index,
Slot value)
|
static OuterScope |
make(ScopeMap map,
Slot[] outers,
int nextOuter,
boolean isMutable,
String optFQNPrefix)
Enabled: |
EvalContext |
newContext(int numLocals)
Enabled: |
private int |
nextIndex()
|
void |
put(String name,
Object newValue)
Enabled: Override to avoid overhead of ForwardingSlot |
NounExpr |
reserveOuterNoun(String name)
Enabled: TODO make this less exposed |
String |
toString()
Suppressed: |
Methods inherited from class org.erights.e.elang.scope.Scope |
asMap, bindFinal, bindings, bindings, get, get, getScopeMap, in, iterate, maps |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Slot[] myOuters
private int myNextOuter
private final boolean myIsMutable
private final String myOptFQNPrefix
Constructor Detail |
private OuterScope(ScopeMap map, Slot[] outers, int nextOuter, boolean isMutable, String optFQNPrefix)
Method Detail |
public static OuterScope make(ScopeMap map, Slot[] outers, int nextOuter, boolean isMutable, String optFQNPrefix)
public String getOptFQNPrefix()
getOptFQNPrefix
in class Scope
Slot getCurrentAtIndex(int index)
public Slot getIndex(int index)
void initIndex(int index, Slot value)
public NounExpr reserveOuterNoun(String name)
reserveOuterNoun
in class Scope
private int nextIndex()
public Scope diverge(String fqnPrefix)
ImportLoader
is
potentially used from multiple vats, and so must be thread-safe. An
ImportLoader holds an OuterScope only for the purpose of diverging new
OuterScopes per emaker eval. Therefore, the state that can be shared
between diverged scopes needs to be thread-safe. That state is
myScopeMap, and ScopeMaps are indeed thread-safe.
diverge
in class Scope
public Slot getSlot(String name)
getSlot
in class Scope
public void put(String name, Object newValue)
put
in class Scope
public void bindOuter(String name, Slot slot) throws AlreadyDefinedException
bindOuter
in class Scope
AlreadyDefinedException
public EvalContext newContext(int numLocals)
newContext
in class Scope
public void cleanup()
To prevent inconsistencies, fill in these holes with ruined slots
cleanup
in class Scope
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |