[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Blog post on explicit locals in Lua
- From: Paul K <paulclinger@...>
- Date: Tue, 5 Jun 2012 11:18:16 -0700
If you're on windows, you may try ZeroBraneStudio
(https://github.com/pkulchenko/ZeroBraneStudio); it provides "Analyze"
function that is based on lua-inspect and metalua. I've implemented my
own AST walker to extend reporting provided by lua-inspect, but also
to make it a bit less verbose. Part of the processing has been
disabled as it gets really slow on large source files; this means
"required" scripts are not loaded, which may impact how global values
are reported.
Grab the latest version from github (git clone
https://github.com/pkulchenko/ZeroBraneStudio.git) and run
zbstudio.exe. Then go to "Program | Analyze". The actual walker is in
https://github.com/pkulchenko/ZeroBraneStudio/blob/master/src/editor/inspect.lua
and you can see what warnings are reported (M.show_warnings).
Paul.
On Tue, Jun 5, 2012 at 10:43 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> I really think which is default is not problem, the problem is *how*
> we know that *is* global/local. has some tools to analyze your code
> and give hint about how many globals you used?
>
> I have tried lua-inspect but it gives me too many things than I need.
> maybe some tools can replace luac and can produce warnings about e.g.
> globals.
>
> 2012/6/4 <rob@hoelz.ro>:
>> Hello list,
>>
>> I've seen a couple of complaints about how Lua uses explicit locals (unlike
>> other popular scripting languages), so I wrote a blog post to address this:
>>
>> http://hoelz.ro/blog/lua-why-explicit-local-is-a-good-thing
>>
>> -Rob
>>
>