From: Michael Selig Date: 2006-11-23T07:24:26+09:00 Subject: Re: type information > - what i ve done till now is this > i ve collected the variables and stored them in the nodes > corresponding to each statement. > > a variable can be indexed using "ruby_scope->local_vars[node->nd_cnt]" This is only for LOCAL variables. > i tried to apply TYPE and CLASS_OF on this but it is giving same value > for all the variables no matter what type of the object it is holding You really need to describe what you are trying to do in more detail. What I *guess* is that you are looking at the "eval tree" before execution. In this case the variables will be all be undefined. It is only when a variable is assigned a value that it will "have a class" - the class is associated with its value, not the variable. For example, you could have the Ruby statement: x = 123 after which x will be a Fixnum. Then: x = "abc" Now it will be a String. So you really cannot create a static list of variables & their classes for a Ruby program. I hope I guessed your motivation correctly! Mike.