Anyone remember Ruby Treasures? Well I was browsing thru some old Ruby Treasures code (written by Paul B. BTW) and I came across a couple implementations for adding annotations to Exceptions. These worked by wrapping special blocks around a raise call. The syntax of those implemenations didn't come off well though, but I started wondering if something like that would be useful if it were part of the 'begin' call instead. Eg. def foo begin 'playing with Ruby' # . . . begin 'doing some silly things' # . . . raise RuntimeError end end end Resulting in somthing like: => test.rb:7 RuntimeError: RuntimeError began -- doing some silly things began -- playing with Ruby from test.rb:2:in `foo' from test.rb:2 Just a thought, T.
on 2006-05-28 03:15