[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pcall and xpcal
- From: Rici Lake <lua@...>
- Date: Fri, 13 Aug 2004 12:22:00 -0500
On 13-Aug-04, at 12:09 PM, Philippe Fremy wrote:
It would have probably been better if xpcall had started as:
xpcall( err_handler, f )
where passing the extra arguments to f just after f would have been
more
logical :
xpcall(err_handler, f, arg1, arg2, ...)
Here, here!
Suggestion:
base library implements:
epcall(errfunc, f, ...)
compatibility code:
function pcall(f, ...) return epcall(nil, f, unpack(args)) end -- *
function xpcall(f, errfunc) return epcall(errfunc, f) end
* unpack doesn't really work here, as Wim has noted. But I think that
will not be an issue with 5.1, and it certainly wouldn't be an issue in
C.