lua-users home
lua-l archive

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

On Wed, Oct 19, 2011 at 1:13 PM, Patrick Mc(avery
<> wrote:
> I do not want globals at all, only a simpler environment to type in-Patrick

When I used module(), I didn't use package.seeall because it was ugly,
so I had to do a lot of this kind of typing up front:

local io,print,getmetatable = io,print,getmetatable

Etc - it does get tedious. Now there are several ways around this
_typing_ problem; one is to some kind of preprocessing and the other
is to make your editor smarter.  Abbreviations help (e.g. defining
'lf' as an abbreviation for a local function block)

But this is the kind of thing that a clever editor can do. I type

local io,print,getmetatable from _G

and run an editor macro - in fact, that macro could be triggered by
simply entering a newline, which is useful because it's hard to
remember all the macros one's defined.

The result is less .. typing, and the code remains reasonably readable.

(I recommend SciTE as a good clever editor that's scriptable in Lua,
but that's just me)

steve d.