For comparison, Python's eval() does have access to locals; Lua's load() does not.
Obviously this is a side-effect of how locals are compiled. It's not possible for eval() to know the identifiers of any corresponding in-scope locals since it's thrown away at compile-time. And when eval() calls riff_compile(), a fresh riff_parser is initialized. Even if a single riff_parser was used, it obviously doesn't necessarily mean existing locals would be visible since riff_parser.locals is effectively a stack.
For comparison, Python's
eval()
does have access to locals; Lua'sload()
does not.Obviously this is a side-effect of how locals are compiled. It's not possible for
eval()
to know the identifiers of any corresponding in-scope locals since it's thrown away at compile-time. And wheneval()
callsriff_compile()
, a freshriff_parser
is initialized. Even if a singleriff_parser
was used, it obviously doesn't necessarily mean existing locals would be visible sinceriff_parser.locals
is effectively a stack.