google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.34k stars 212 forks source link

repl: treat load bindings as global in the REPL #226

Closed alandonovan closed 5 years ago

alandonovan commented 5 years ago

PR #178 made them local to the file, but each statement in the REPL is its own "file". This change sets (and restores) the flag for the legacy behavior in the REPL.

This change is more workaround than fix, as it is not safe w.r.t. concurrent interpreters, but we already have problems of that kind. Perhaps we need to plumb options more thoroughly instead of using globals.

Updates #224