Documentation ¶
Index ¶
- type Activation
- type Activations
- func (a *Activations) CurrentOrNew() Activation
- func (a *Activations) Depth() int
- func (a *Activations) Find(key string) interface{}
- func (a *Activations) Pop()
- func (a *Activations) Push(activation Activation)
- func (a *Activations) PushCurrent()
- func (a *Activations) Set(name string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activation ¶ added in v0.6.0
func NewActivation ¶ added in v0.6.0
func NewActivation() Activation
func (Activation) Find ¶ added in v0.6.0
func (a Activation) Find(name string) interface{}
func (Activation) FirstRest ¶ added in v0.6.0
func (a Activation) FirstRest() (string, interface{}, Activation)
func (Activation) Insert ¶ added in v0.6.0
func (a Activation) Insert(name string, value interface{}) Activation
type Activations ¶
type Activations struct {
// contains filtered or unexported fields
}
Activations is a stack of activation records. Each entry represents a new scope.
func (*Activations) CurrentOrNew ¶
func (a *Activations) CurrentOrNew() Activation
func (*Activations) Depth ¶
func (a *Activations) Depth() int
func (*Activations) Find ¶
func (a *Activations) Find(key string) interface{}
func (*Activations) Pop ¶
func (a *Activations) Pop()
func (*Activations) Push ¶
func (a *Activations) Push(activation Activation)
func (*Activations) PushCurrent ¶
func (a *Activations) PushCurrent()
PushCurrent makes a copy of the current activation, and pushes it to the top of the activation stack, so that the `Find` method only needs to look up a certain record by name from the current activation record without having to go through each activation in the stack.
func (*Activations) Set ¶
func (a *Activations) Set(name string, value interface{})
Set adds the new key value pair to the current scope. The current scope is updated in an immutable way.
Click to show internal directories.
Click to hide internal directories.