[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: revectoring
- From: "Peter Prade" <Peter.Prade@...>
- Date: Sun, 19 Jan 2003 23:30:44 +0100
> I wish to dynamically revector the Lua functions write,
> writeto, read and readfrom so that the original function
> is called when not using stdin/stdout but calls my function
> when using stdin/stdout.
>
> Can anyone help?
perhaps something along these lines? (out of my head, untested code)
function write(...)
if type(arg[1]) == "userdata" then -- filehandles are userdata
call(%write,arg)
else
call(%mywrite,arg) -- or just do whatever you want here
end
end