Message Passing System?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Message Passing System?

Post by Inny »

kikito wrote:I think inni meant ruffian.signal.send( "zomg" ).
Correct, I accidentally used the wrong syntax when typing up the example.
Nevertheless, it is possible to create a "callable" table in Lua using metatables. That's probably what he meant with "(or which metatables)".
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:
https://github.com/inmatarian/landofway ... l.lua#L262
Post Reply

Who is online

Users browsing this forum: pgimeno and 4 guests