From: Phlip Date: 2004-10-16T11:39:28+09:00 Subject: retrieve column # of calling function Florian Gross wrote: > Phlip wrote: > > > require 'trace' > > > > def foo() > > complicatedThing = "simple thing" > > trace_{complicatedThing} > > end > > You can also do that with Binding.of_caller (see attachment), btw: > > def trace(code) > Binding.of_caller do |context| > file, line = eval("[__FILE__, __LINE__]", context) > result = eval(code.to_s, context) > STDERR.puts "In #{file} at #{line}: #{code} => #{result}" > end > end > > something = 5 > trace :something > trace "[self, something]" Thanks; that's good to know. But... ....I'm primarily interested in the _column_number_. Upgrading trace_{} is a nice second. -- Phlip http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces