[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Polymorphic luaL_checkudata?
- From: Peter Odding <xolox@...>
- Date: Mon, 16 Apr 2007 20:07:26 +0200
Mark Edgar wrote:
You don't think it's bad style to add (get|set)_timeout to the file
methods? Not trying to criticize, just interested in your opinion.
Not as long as your new methods fail properly when called with
Fair enough :)
Must? You /are/ talking about code I'm writing, right? As of yesterday my
tofile() helper checks for either of the file/pipe metatables. Does this not
give the same functionality? If so, I have overlooked something...
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.
Not sure I can make APR's sockets as easy as files and pipes but I'm planning to
at least give it a try. I think it would really fit Lua to make APR's
file/pipe/socket i/o interface obey the same interface *subset* (using separate
but `compatible' metatables allows additional methods so I don't have to dumb
down the interface just to make it compatible).
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.
I can always try! We'll see how it works out.
- Peter Odding
 the name is really a misnomer now, obviously