[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Requesting Suggestions for intermediate/advanced book on Lua
- From: Paul K <paulclinger@...>
- Date: Thu, 3 Oct 2013 23:49:11 -0700
Hi Steve,
> It remains my preferred way of debugging Lua. Call me old-fashioned,
> but it works. Maybe a little more typing than I'd like (but: hello,
> printf!) and sometimes I miss macros so I could write 'out(a,b,c)' for
> 'a = ..., b = ...., c = ....' but then that's just me; could teach my
> editor to do that.
I'm glad I'm not the only one still using that ;). Try to debug a
debugger or debug hooks that don't throw errors without "print".
ZBS actually helps in some ways with "prints" as well. For example, if
you have "print(foo)" in your code, it can not only send the output to
the Output window, but it will also pretty-print the results for you
(when "debugging", not "running"). Some interpreters (Corona, Gideros,
Marmalade Quick) enable this by default, but it can be enabled for
regular Lua interpreter as well (debugger.redirect in
http://studio.zerobrane.com/doc-general-preferences.html#debugger).
Redirecting remote output is useful when you do debugging on a device
and stdout redirect is not available. Pretty-printing allows to write
"print('tbl=', tbl)" and to get a printed table (including nested
tables).
Another print-related option is to send "print"ed data in real time to
the Watch window. You write "print('foo=', foo)" and the value of
"foo" will be shown in the Watch window as your application is
executed (also pretty printed). This is useful for those cases when
the values are changing frequently and you don't want to sift through
output lines, but want to quickly see the current values:
http://notebook.kulchenko.com/zerobrane/real-time-watches-plugin-zerobrane-studio.
> I will say that ZBS is a very good debugger (although I find it too
> 'active' to use as my standard editor) ...
What does "too 'active'" mean in this context? ;)
Paul.