Calling lua function which name is stored in string

darqan <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Hello,

Is it possible (in plain LUA) to call a (LUA) function which name is stored
in string (like reflection)? 

What I want to do is something like:

function foo( object )
   func = string.format("script_%s", object:getValue() )
   -- somehow call function which name is stored in variable 'func'  (e.g.
script_shoot )
end

Of course this is easy to do so that I generate the string in c++ and call
LUA function from there but I really would like to do this whole thing in
LUA if it is possible.

Thank you.

-- 
View this message in context: http://www.nabble.com/Calling-lua-function-which-name-is-stored-in-string-tp22522841p22522841.html
Sent from the Lua C++ Bind mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.