On Tue, Jul 3, 2012 at 7:13 PM, Reginald Tan <[email protected]> wrote:
>>
>> What about debug output?  You can make that pretty efficient:
>>
>> if ENV["DEBUG"]
>>   def debug; $stderr.puts(yield) end
>> else
>>   def debug; end
>> end
>>
>> debug { sleep 1; "Complex operation" }

> Hi Robert, I'm not sure I understand what you mean. Isn't that the same
> as just inserting a puts statement in the code or putting logger debug
> statements around the code?

Sort of, just a tad smarter.

> What I wish to do is to inspect the
> variables at any line of execution without modifying the original
> program :)

Oh, that requirement wasn't given as far as I can see.  That's
something different of course.

Why would the debugger not work for you?  If you know the line (as you
said earlier) you can use that information to set a breakpoint and
inspect data when you've hit the breakpoint.

Can you explain what goal you are trying to achieve?

Cheers

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to