Page 1 of 1

[Suggestion] dynamic function call

Posted: 05 Oct 2011, 15:56
by gouxim
Hey,

This is a "high end" suggestion. I'm not sure it's even possible. I would love to be able to do dynamic function calls (à la http://php.net/manual/en/function.call-user-func.php) ie. you specify the function name with a String and you pass the parameters in some other way (in php you can either put the params as params of call_user_func, or in an array with call_user_func_array but they require respectively dynamic param numbers and heterogenous arrays - both of which seem not to be possible in ManiaScript).

The obvious use case for that is to implement patterns such as event listener, dependency injection etc. (more precisely I have a standard main loop function, and i would be able to dynamically plug new function that listen to the events on that main loop).

Re: [Suggestion] dynamic function call

Posted: 09 Oct 2011, 22:03
by Bueddl
agree to this, too, I also was coding in that way and looked for that feature.

Re: [Suggestion] dynamic function call

Posted: 21 Mar 2012, 15:40
by gouxim
moved in the right forum...

Re: [Suggestion] dynamic function call

Posted: 21 Mar 2012, 15:40
by magnetik
+1