lua-users home
lua-l archive

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


Hello,
You might also look at LuaGravity.
This mechanism looks like a `link` between two Lua functions:

function a ()
    return 1
end
function b (v)
    return v * 2
end
function c (v)
    print(v)
end
link(a, b)
link(b, c)
a()

By executing `a`, when it returns 1, `b` is triggered receiving that value.
Then `b` returns 1*2 and `c` is called, printing 3.

--
Francisco Sant'Anna
http://www.lua.inf.puc-rio.br/luagravity/

On Mon, Mar 22, 2010 at 5:06 PM, Valerio Schiavoni <valerio.schiavoni@gmail.com> wrote:
Hello,
the twisted python framework provides a very elegant mechanism to do
asynchronous programming, through so called 'deferred'.
See doc here: http://twistedmatrix.com/documents/current/core/howto/defer.html

I was wondering if there's support for this programming style in the
language itself (looking at the doc I don't think so), or if
something similar is provided by Lua frameworks.

thanks,
valerio