// Copy the state of the virtual machine environment
Copy the state of the virtual machine environment
// Copy the state of the virtual machine environment
func (e *Env) Copy() *Env {
	e.Lock()
	defer e.Unlock()
	copy := Env{
		name:     e.name,
		env:      make(map[string]reflect.Value),
		typ:      make(map[string]reflect.Type),
		parent:   e.parent,
		external: e.external,
	}
	for name, value := range e.env {
		copy.env[name] = value
	}
	for name, typ := range e.typ {
		copy.typ[name] = typ
	}
	return &copy
}
func ( e * Env ) Copy ( ) * Env { e . Lock ( ) defer e . Unlock ( ) copy := Env { name : e . name , env : make ( map [ string ] reflect . Value ) , typ : make ( map [ string ] reflect . Type ) , parent : e . parent , external : e . external , } for name , value := range e . env { copy . env [ name ] = value } for name , typ := range e . typ { copy . typ [ name ] = typ } return & copy }
Copy the state of the virtual machine environment
Copy the state of the virtual machine environment