# RCR Suggestion: Binding#eval

**URL:** <https://rubytalk.org/t/rcr-suggestion-binding-eval/11467>\
**Category:** ruby-talk\
**Created:** [11 May 2004 08:09 UTC](https://rubytalk.org/t/rcr-suggestion-binding-eval/11467 "2004-05-11T08:09:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehr\_Assaph\_Assaph](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@Mehr\_Assaph\_Assaph](https://rubytalk.org/u/Mehr_Assaph_Assaph)\
**Post date:** [11 May 2004 08:09 UTC](https://rubytalk.org/t/rcr-suggestion-binding-eval/11467/1 "2004-05-11T08:09:14Z")

</div>

> # Returns the Method that was active, if any, when the binding was

created

> def method() …???..
> 
> # Returns the Proc that was active, if any, when the binding was

created

> def proc() … ??? …
> 
> # Returns the call stack, same format as Kernel##caller()
> 
> def caller( skip = 0 ); eval( “caller( #{skip})”) end

What whould also be nice, is that caller in this context return an array  
of Bindings (i.e. Object#method) and not of string (of “file: line:  
…”).

---

<div class="post-metadata">

**Author:** ![Jean-Hugues\_ROBERT](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@Jean-Hugues\_ROBERT](https://rubytalk.org/u/Jean-Hugues_ROBERT)\
**Post date:** [11 May 2004 08:20 UTC](https://rubytalk.org/t/rcr-suggestion-binding-eval/11467/2 "2004-05-11T08:20:26Z")

</div>

I could not agree more ! I have been missing that feature a lot and  
the work around with set\_trace\_func() is just too slow for me.

– JeanHuguesRobert

> **···**
>
> At 17:09 11/05/2004 +0900, you wrote:
> 
> > > # Returns the Method that was active, if any, when the binding was
> > 
> > created
> > 
> > > def method() …???..
> > > 
> > > # Returns the Proc that was active, if any, when the binding was
> > 
> > created
> > 
> > > def proc() … ??? …
> > > 
> > > # Returns the call stack, same format as Kernel##caller()
> > > 
> > > def caller( skip = 0 ); eval( “caller( #{skip})”) end
> > 
> > What whould also be nice, is that caller in this context return an array  
> > of Bindings (i.e. Object#method) and not of string (of “file: line:…”).
> 
> * * *
> 
> Web: [@jhr is virteal, virtually real](http://hdl.handle.net/1030.37/1.1)  
> Phone: +33 (0) 4 92 27 74 17
