This is strictly a breaking change, but the changed functions (the Local methods) were previously documented as experimental. The fix is straightforward.
Also, a test of DebugFrame to write an 'env' function in a similar vein to Python's 'dir' function.
This change adds the following new API to allow debugging tools and built-in functions access to the internals of Function values and call frames:
package starlark
type Binding struct { Name string Pos syntax.Position }
func (fr frame) NumLocals() int func (fr frame) Local(i int) (Binding, Value)
type DebugFrame interface { ... NumLocals() int Local(i int) (Binding, Value) }
func (fn Function) NumFreeVars() int func (fn Function) FreeVar(i int) (Binding, Value)
This is strictly a breaking change, but the changed functions (the Local methods) were previously documented as experimental. The fix is straightforward.
Also, a test of DebugFrame to write an 'env' function in a similar vein to Python's 'dir' function.
Fixes #538