This is largely irrelevant for anything related to developing asynchronous services such as web or servers. Asynchronous web development using callbacks is a form of continuation passing style, where control is often explicitly passed using a callback. Since you are explicitly passing control, you usually never have to return values anyway. The 'return' keyword just becomes a bonus feature for convenient error handling.
Having a language with good closure support just works phenomenally well for asynchronous web development. For instance, sending an entire message asynchronously can be a pain because it can fail at any point in the message and require restarting at that point and keeping track of when it has finished.
It's a piece of cake in Lua though, due to its excellent support for closures:
-- SendAll
-- Start sending a message on connection [c]
-- Close when done.
function SendAll(c, msg)
local n=0
OnWrite(c, function(c)
n=n + c.fd:send(msg, n)
if n>=#msg then
c.fd:close()
return 'close' -- just for kicks
end
end)
end
The variable "n" is a counter for the number of bytes sent to the file descriptor "fd". The write callback lambda assigned with OnWrite can always access the appropriate counter "n" based on its creation location. No extra work was needed to create the closure, unlike in languages such as JavaScript.