From: "Hal E. Fulton" Date: 2001-12-14T07:21:46+09:00 Subject: [ruby-talk:28466] Re: func_eval? ----- Original Message ----- From: Issac Trotts To: ruby-talk ML Sent: Thursday, December 13, 2001 4:05 PM Subject: [ruby-talk:28462] Re: func_eval? > 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. An interesting idea, and it's been discussed before... One problem I see is that if a method you call can get your binding *without your knowledge* (I'm personifying the calling method as "you")... then you can't rely on your own local variables being unchanged by any method call. This is contrary to the principle of data hiding, IMO. It's not that it could be used maliciously, but abused accidentally. Am I mistaken? def meth2 #... eval("x=6", caller_binding()) end def meth1 x = 5 meth2 puts x end meth1 # Prints 6 for x! Hal Fulton