[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: upcoming changes in Lua 5.2
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 20 Feb 2008 10:45:32 -0300
> Have you considered the idea recently discussed on this list of having
> some type predicates which could used instead of "type(...) = ..."
> (given that the latter is often flaky and the wrong thing in the
> presence of metatables).
>
> E.g., callable(...), indexable(...) etc.
>
> Maybe a single general predicate would work, e.g., something like
> "applicable (OBJ, KEY)" where KEY is the assocated metamethod ('__call',
> '__index', etc).
We are considering this, but only for C (probably in the auxlib). I
guess in Lua most programs simply do the call, without any checks. (This
approach would be another option for C.)
-- Roberto