[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [PROPOSAL] more luaL_check* in lauxlib.h (for Lua 5.2)
- From: Miles Bader <miles@...>
- Date: Thu, 02 Jun 2011 09:45:16 +0900
Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br> writes:
> I think there is no efficient way to check if a given object
> is callable. I would say that one should protect-call it and check if
> it throws an error. Thus you'd better not check it :-)
isn't it just
function callable (x)
return type(x) == 'function' or getmetatable(x).__call
end
?
-Miles
--
One of the lessons of history is that nothing is often a good thing to
do, and always a clever thing to say. -- Will Durant