RubyFlow The Ruby and Rails community linklog

Counting Block Nesting Depth in Ruby

This problem recently popped up on the SF Ruby mailing list, in which someone needed to count the current block nesting depth during runtime. It turned out to be a fun and informative exercise in exception handling, thread-safety, and metaprogramming. So I wrote an article :-)

Counting Block Nesting Depth in Ruby (an Exercise in Exception-handling, Thread-safety, & Meta-programming)

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in