lua-users home
lua-l archive

Re: _G function inside table

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


On Fri, Jun 24, 2011 at 3:57 PM, Kev Lugli <kevlugli@gmail.com> wrote:
> Hi, I'm trying to do something like this, but I've got no success yet.
>
> a = 'func'
> var={}
>
> function _G['var.'..a](a)
>  print 'a'
> end
>
> var.func()
a = 'func'
var = {}
_G.var[a] = function (a)
 print(a)
end
var.func("a")
-- 
- Patrick Donnelly

AltStyle によって変換されたページ (->オリジナル) /