[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Stack Debugging
- From: "Alex Davies" <alex.mania@...>
- Date: Sat, 10 Jan 2009 13:38:10 +0900
David Manura wrote:
On Fri, Jan 9, 2009 at 10:29 PM, James Rhodes wrote:
cout << i << ": string : " << lua_tostring(lstack,i) << endl;\
Careful: lua_tostring has side-effects (perhaps the name of this
function is misleading). It's also more correct to do
"if(lua_toboolean(lstack,i) != 0)" .
Was my first thought too... but perhaps cleverly accidently he checks that
it isn't a number before checking if it's a string. So side effect free :)
Must say though stack watches are brilliant for working with the lua stack,
although writing a good table printer without side effects/recursion
problems is hard.