lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Thu, Dec 31, 2009 at 7:45 AM, David Kastrup <dak@gnu.org> wrote:
Tiago Katcipis <katcipis@inf.ufsc.br> writes:

> First of all, this is my first post on this list, forgive me if the
> question is not brilliant :-).
>
> I am starting to develop a application on Lua and since there is the
> need to do a lot of communication between objects, to loose coupling i
> was thinking on using some kind of generic purpose notification system
> like GSignal (http://
> library.gnome.org/devel/gobject/unstable/gobject-Signals.html), or
> like the event system used on QT, using something like this raises the
> flexibility of the system. Building a notification system in Lua is
> not very hard, but it is useless to build a new one if maybe there is
> something already done.

The one thing you should keep in mind is that most signaling frameworks
are a crutch for obliterating independent control flows by some
signaling conventions.

Lua has synchronous coroutines which allow you to use normal function
calls for passing information between independent control flows.

coroutine.wrap is most of what you need for working with the equivalent
of "signals".


Thanks David, this is an interesting insight, I'm reading other people implementation of a notification system to have an idea of what is better to me, but something generic sens to be hard to do for Lua, it sens to be specific for each application.
 
--
David Kastrup