lua-users home
lua-l archive

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


on 6/29/06 1:12 PM, Diego Nehab at diego@tecgraf.puc-rio.br wrote:

> Hi,
> 
>> I would prefer a version of lua_tostring (and lua_tonumber) that didn't do
>> the conversion at all. It's magic that I don't need.
> 
> Everyone would like that. :)
> 
> For lua_tonumber, this seems easy to do. But for
> lua_tostring, where would the returned string be? It has to
> be allocated somewhere, and it has to be collected at some
> point, but only after the object you are calling it on
> leaves the stack.

There wouldn't be a string. lua_tostring_noconvert when pointed at a number
would return NULL.

Mark