lua-users home
lua-l archive

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


On 25 June 2012 19:34,  <meino.cramer@gmx.de> wrote:
> Hi,
>
> (Warning! Newbie ahead!)
>
> With UNIX systems you can build chains of cammands
> on the commandline eacht connected via stdout/stdin.
>
> Is it possible to chain lua-functions in a similiar way, that is:
> To create an output stream with one function which gets the
> input stream of another function?
>
> Is taht possible (portable...)?

You can implement this kind of chaining (source -> filter -> ... ->
filter -> sink) using this code [1] by Diego Nehab, which is also
extensively used in LuaSocket. It is a very interesting reading and I
suggest you read through it.

[1] http://lua-users.org/wiki/FiltersSourcesAndSinks