[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: canonical way to type a variable?
- From: "jason bright" <jaybright@...>
- Date: Wed, 25 Oct 2006 16:37:35 +1000
Hope this isn't too stupid of a question.... we've got three of us here with marginal Lua knowledge :) and it's stumped all of us.
What is the canonical, or better, the most efficient way of determining the current type of a Lua variable?
"type(myVar)" returns a string -- which is correct, but doing lots of string compares seems very inefficient (I need to argument check on some heavily used functions).
In the C api we've got lua_type() that gives an enumerated type.
Is the only way within Lua to do string compares? I've been all over the docs and haven't seen anything else.
(I told you it was stupid :)
thx - j