lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Sep 6, 2013 at 7:29 AM, Rob Kendrick <rjek@rjek.com> wrote:
> On Fri, Sep 06, 2013 at 02:26:06PM +0200, Karol Drożak wrote:
>> How can I manipulating local variables from C in Lua 5.2?
>
> In general: don't.


right.

"local" to a lexically-scoped language means "local to the code
specified in this piece of text".  a C function is at another lexical
context, so by definition it shouldn't be able to meddle with Lua
local variables.

of course, there are ways to do it, either via the debug API, or
hacking the interpreter itself.  But neither of those are meant to be
used as "normal execution", and that's by design, not because of
oversight.

-- 
Javier