lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Alex Davies wrote:
> Hans van der Meer wrote:
> 
>> My point then is: Given the series of lua_is's and luaL-check's, may
>> I  be so bold as to suggest addition to the upcoming version of Lua
>> of  something as lua_isrealstring?
> 
> It'd be faster to do (lua_type(L, n) == LUA_TSTRING).
> 
> That's all the other macros (non isstring/isnumber) do anyway.
> 
> :)
> 
> - Alex

Personally, I think the real solution is to remove automatic
string<->number coercion; on a stylistic level, it's weird, with two
types getting special treatment, and on a pragmatic level it seems to
cause far more problems than it solves, especially when using the C API,
where it actually *mutates the stack* rather than just implicitly casting.
	Ben