lua-users home
lua-l archive

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


Hi there,

Today i wanted to do this:


Table={}
local Function="MyFunction"
function Table[Function] ()
   print("Hello World")
end

and i got an error!

I thought 

function Var() ... end

was full "syntatic sugar" for

Var = function () ... end

but it sad-to-know isn't because

Table[Function] = function () 
   print("Hello World")
end

works fine.

What's the Problem? A Bug? Or even intenion?

Regards,
   Dominik