On 25.03.2012 22:21, Alexander Yakushev wrote:
> On 03/25/2012 10:11 PM, Uli Schlachter wrote:
>> Perhaps these should be called "dump"?
> Good enough for me. I'll be renaming it locally to something shorted anyway.
>> Personally, I'd prefer:
>>
>>    shift = (shift or "") .. "  "
>>
>> (Because the two spaces are repeated one time less)
> Yes, this one is better.
>>> +    for k, v in pairs(data) do
>>> +        result = result .. "\n" .. shift .. d_raw(v, shift, k)
>>> +    end
>> I wonder if this should also print the table keys. If I print e.g. the 
>> arguments
>> to awful.wibox(), that would be helpful.
>> I guess it isn't easy to come up with a good format for that. Ideas?
> Actually it does print the table keys. It just doesn't seem obvious. You 
> can see that a key is passed as a third argument to the d_raw 
> recursively so it gets printed.
>> What's "ETDP"? What is "log.d_return"? I guess this is some old stuff and 
>> that
>> this code was previously called "log"? Which would mean that this does not 
>> work
>> anymore...
> My bad.
>> Also, I don't really like the idea of require()'ing "naughty" from here. This
>> leads to a cyclic dependency between "naughty" and "gears.debug". :-(
>>
>> Yes, this is helpful, but I don't know a good way around this problem (except
>> for adding e.g. naughty.debug() which uses gears.debug.d_return (which will 
>> then
>> be called dump_return)?)
> This sounds better. Sending in another patch.

Thanks. Pushed.

In other news, I'm stupid. Testing with gears.debug.dump(awful) was a bad idea,
because that table contains loops (awful._M points back to awful) and thus sent
the code into an endless loop eating memory and freezing my system. Meh.

Uli
-- 
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?" -- A. P. J.

-- 
To unsubscribe, send mail to [email protected].

Reply via email to