# 17 — `_` is global rather than local **Status:** open The `_` result variable from interactive commands (`!cmd`) is set as a global via `lua_setglobal(L, "_")`. This has several implications: - It can escape its scope and pollute other scopes - A function may silently overwrite `_` if it uses shell commands internally, surprising the caller - Lua convention uses `_` as a throwaway variable in `for` loops (`for _, v in pairs(t)`) ## Investigation needed - What are the concrete consequences of `_` being global vs local? - Can we make it local to the REPL line instead? - Should we use a different name entirely?