lua-users home
lua-l archive

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


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.

Yes, you could open space for a string reference on each
object, and use it to referene the new string object created
by lua_tostring (which would be outside the stack). But is
this any better than what we have now? Wouldn't it increase
the size of every Lua object?

It would be nice to have a final solution for this problem.
One that could be used with other things besides numbers...