lua-users home
lua-l archive

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


Alexander Gladysh wrote:
I need to declare opN functions somewhere. As they wouldn't be used in
such context anywhere else, and they should have convenient short and
common names, I want to have their scope as local as possible.
What about:

local foo
do -- foo init
 local function bar1(...) end
 local function bar2(...) end
 local function bar3(...) end

 foo = {bar1 "1", bar "2", bar "3"}
end

Looks weird, but sometimes helps me.