lua-users home
lua-l archive

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


On 4/15/07, Peter Odding <xolox@home.nl> wrote:
You don't think it's bad style to add (get|set)_timeout to the file userdata
methods? Not trying to criticize, just interested in your opinion.

Not as long as your new methods fail properly when called with
non-pipes.  If you want to integrate pipes so that they can be used
wherever a file is expected (and this seems a good thing) then you
must use the same metatable.

This is basically the same thing I've done with pipes in the "ex" API
too, by the way.  It might be nice if there was also an API which did
the same thing for network connections too.

Note that I know nothing at all about APR and its abstractions.  It
might not make sense to attempt to unify the APR API and the Lua API.

    -Mark