lua-users home
lua-l archive

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

On Mon, Oct 06, 2014 at 02:15:36PM +0200, Charles Smith wrote:
> Okay, I got it to work:
> v = "m1"
> function m1 ()
>     print ("hello world")
> end
> _G[v]()

I'm trying, and failing, to see a situation where this is the most
elegant solution.

Can't you just define the function first?  Calling functions by name
rather than value is fraught with horror.