Re: Message Passing System?
Posted: Tue Apr 10, 2012 5:46 pm
Correct, I accidentally used the wrong syntax when typing up the example.kikito wrote:I think inni meant ruffian.signal.send( "zomg" ).
The "with metatables" part means that instead of the closure I used, which could be very memory inefficient, I could stuff the binding information in a table and do magic with the metatable. This code of mine demonstrates how I generally do callbacks in a space efficient way:Nevertheless, it is possible to create a "callable" table in Lua using metatables. That's probably what he meant with "(or which metatables)".
https://github.com/inmatarian/landofway ... l.lua#L262