# Runtime evaluation of variables

**URL:** <https://rubytalk.org/t/runtime-evaluation-of-variables/60341>\
**Category:** ruby-talk\
**Created:** [6 October 2010 15:49 UTC](https://rubytalk.org/t/runtime-evaluation-of-variables/60341 "2010-10-06T15:49:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romaric\_ludinard\_Rom](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Romaric\_ludinard\_Rom](https://rubytalk.org/u/Romaric_ludinard_Rom)\
**Post date:** [6 October 2010 15:49 UTC](https://rubytalk.org/t/runtime-evaluation-of-variables/60341/1 "2010-10-06T15:49:33Z")

</div>

Hi there,

I'm currently working with ruby and set\_trace\_func function. I need to  
find local\_variables, instance\_variables and method parameters.

for local variables and instance variables, something like that works :  
set\_trace\_func proc { |event, file, line, id, binding, classname|  
local = eval("local\_variables", binding)  
instance = eval("instance\_variables", binding)  
...  
}

but I can't find a way to find method parameters....

In fact, method parameters seems to be include in local variables,but on  
call event, I can't distinguish some null parameters and come local  
variables not yet assigned

Am I wrong ?

Is there another way to solve my problem ?

Thanks

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
