[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: All your local are belong to us
- From: Patrick Donnelly <batrick@...>
- Date: Fri, 2 Oct 2015 16:51:06 -0400
On Fri, Oct 2, 2015 at 4:48 PM, Patrick Donnelly <firstname.lastname@example.org> wrote:
> On Fri, Oct 2, 2015 at 3:25 PM, Dirk Laurie <email@example.com> wrote:
>> 2015-10-02 20:54 GMT+02:00 Parke <firstname.lastname@example.org>:
>>> Egor's original suggestion was that a warning be added to the REPL to
>>> alert new users of the schism. A REPL warning in response to
>>> singleton statements of the form "local namelist [‘=’ explist]" seems
>>> like a good idea to me.
>> The difficulty is that this is not a simple matter of changing
>> a few lines in lua.c. One needs functionality equivalent to
>> luac to diagnose the situation.
> It's simpler than that. You can use lua_getlocal to determine if the
> chunk defined any locals.
Nevermind, no you can't. When you run lua_getlocal on a closure, you
only get information about its parameters. I thought there was an API
to get the local count but I guess not...