lua-users home
lua-l archive

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


On Fri, Oct 2, 2015 at 4:48 PM, Patrick Donnelly <batrick@batbytes.com> wrote:
> On Fri, Oct 2, 2015 at 3:25 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> 2015-10-02 20:54 GMT+02:00 Parke <parke.nexus@gmail.com>:
>>
>>> 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...

-- 
Patrick Donnelly