Lambda / inline functions

Hi, is it possible to write inline functions when executing to the callback on a timer or transition?

timer.performWithDelay(1000, (function(e) dosomething...))

According to http://en.wikibooks.org/wiki/Lua_Functional_Programming/Functions its possible, but I can’t seem to write it in the correct format to get it to work.

Note: I come from 6 years of Javascript so if its a case of round peg square hole please let me know.

Cheers, IJ

This format works for me.

timer.performWithDelay(1000, (function() print(“testing inline function”) end))

Ha ha! - school boy mistake - coming from javascript I seem to have a real blind for ‘end’ terminations of functions.

This tutorial might be of assistance:

http://coronalabs.com/blog/2014/02/18/tutorial-anonymous-functions-and-closures/

Rob

Thanks rob - thats a great resource.

This format works for me.

timer.performWithDelay(1000, (function() print(“testing inline function”) end))

Ha ha! - school boy mistake - coming from javascript I seem to have a real blind for ‘end’ terminations of functions.

This tutorial might be of assistance:

http://coronalabs.com/blog/2014/02/18/tutorial-anonymous-functions-and-closures/

Rob

Thanks rob - thats a great resource.