Re: quick print type debugging
- From: Florian Groß <florgro@xxxxxxxxx>
- Date: Sat, 10 Sep 2005 01:13:18 +0900
Eric Mahurin wrote:
What would be nice is if you could somehow convert the block
back to text (and put it in the debug message). Anybody know
how to do that? I know I could make the block be a string of
the code instead to solve the problem (d{"..."}), but that
would be uglier and less efficient when we have debugging off
(because we have to eval).
See attachment. It's not very general, though.
I think I'd go with the string solution, use Binding.of_caller to put it into the right context and alias it to a method that does nothing when $DEBUG isn't set.
Attachment:
binding_of_caller.rb
Description: application/ruby
Attachment:
proc_source.rb
Description: application/ruby
- Follow-Ups:
- Re: quick print type debugging
- From: Eric Mahurin
- Re: quick print type debugging
- References:
- quick print type debugging
- From: Eric Mahurin
- quick print type debugging
- Prev by Date: Re: quick print type debugging
- Next by Date: Re: quick print type debugging
- Previous by thread: Re: quick print type debugging
- Next by thread: Re: quick print type debugging
- Index(es):
Relevant Pages
|