[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: 3 q's: lua_sethook in coroutines :: co-routine return values :: nice variable dumper
- From: Peter Bradshaw <flatfeetpete@...>
- Date: Thu, 24 Jun 2004 09:31:22 -0700
I'm performing an experimental integration of lua into a telephony app
and have a 3 questions I hope someone with strong lua-fu can help me
1. lua_sethook and coroutines
As an ineffcient aid to let me see what's happening I've uses the C
lua_sethook to trace as every line goes thru the interpreter.
Unfortunately the fact I'm using coroutines seems to intefere with
it's behavior and I don't get messages within the coroutines. Do I
need to call set_hook at certain times (I'm currently only calling it
after the inital lua open).
2. co-routine return values.
This is more of a sanity check, so I'll say how I think it works and
you can slap me down for my ignorance. If I coroutine.yield ( co ,
'fred ', 'jane' ) then
assert( coroutine.resume( co , 'otherargs] )) will return 'fred', 'jane'
3. nice variable dumper.
When I'm stuck hacking perl, I'll often rely on Data::Dumper to let me
see what's going on. Is there an equivalent. I found serial.serialize,
but it relys on having a table and is for saving rather than giving
you full fn. defn's etc.
Thanks for your time.