From: Issac Trotts Date: 2001-12-14T07:24:29+09:00 Subject: [ruby-talk:28467] Re: func_eval? Well, I only want it for read-only access so it shouldn't be too dangerous. What's so bad about a convenience function like the following? def printvar(varname) puts "varname = #{get_value_of_var_from_caller(varname)}" end #get_value_of_var_from_caller would be implemented in terms of the ideas in [ruby-talk:22963]. Issac > -----Original Message----- > From: Paul Brannan [mailto:paul@atdesk.com] > Sent: Thursday, December 13, 2001 3:13 PM > To: ruby-talk@ruby-lang.org > Subject: [ruby-talk:28465] Re: func_eval? > > > On Fri, Dec 14, 2001 at 07:05:17AM +0900, Issac Trotts wrote: > > That's a good thing to know, and it almost answers my question. > > But I still would like to have a way to get the binding of > > the function that called whichever function is currently > > executing. > > This isn't a particularly safe or good thing to be able to > do, and Ruby > doesn't let you do it easily. > > See [ruby-talk:22963] and [ruby-talk:12401] for some ugly (and slow) > examples of how to do this. > > Paul >