# Runtime evaluation of variables

**URL:** <https://www.ruby-forum.com/t/runtime-evaluation-of-variables/196089>\
**Category:** Ruby\
**Created:** [October 6, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/runtime-evaluation-of-variables/196089 "2010-10-06T17:46:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romaric\_ludinard\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a9adbd/32.png) [@Romaric\_ludinard\_R](https://www.ruby-forum.com/u/Romaric_ludinard_R)\
**Post date:** [October 6, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/runtime-evaluation-of-variables/196089/1 "2010-10-06T17:46:29Z")

</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
