Open jbee opened 13 years ago
The rebind
and bind
can be rewritten so that newly defined variables during the bind will be bind
also. Therefore we can do a loop starting at the last index of the definitions list. The loop is done when index 0 has been bound. As counter we count the amount of already bound definitions (counting from the end of the list). This will always increment by 1 in a loop.
The index to bind
/rebind
next is list.length() - bound - 1
.
We can pass a int
parameter rebinds
that is the amount of rebind
s done before bind
is used. Through that we can use the same loop/method for both: bind and rebind.
When a
Var
is overridden, the new definition is prepanded. In addition there has to be a search starting a zero/one for the first definition of the same variable. This has to be marked asoverridden
so that it will not be bound any more. The context should keep track of the lastBehaviouralFunctor
that is not overridden to reduce lookup costs.