From: Austin McDonald Date: 2004-06-12T15:33:17+09:00 Subject: Re: Any way to get the calling method's binding? In the meantime, you could do this: def trace (expr) LOG.debug "#{expr} = #{yield expr}" end def something x=5 x=7 trace "x+y", {|n| eval n} end something => 12 I'll admit that it'd be nice if the block passing could be automated; not sure how to do that off the top of my head. This reminds me of dynamic scoping; anybody got any clue about how to do away with the block? Maybe there's a way to do this with an extension? Austin Joel VanderWerf wrote: > Gavin Sinclair wrote: > >> Something I've wanted to do on a few occasions recently is to evaluate >> an expression in the context of the calling method. A simple example >> is this: > > > It's being discussed: > > http://rcrchive.net/rcr/RCR/RCR253 > >