From: Joe Pikachu Date: 2010-11-26T20:25:46+09:00 Subject: Re: instance_eval vs attr_reader Thanks for everyone who replied. I MADE A MISTAKE IN MY ORIGINAL EXAMPLE. What I meant to compare speed/memory wise was: my_class.instance_eval {@var} vs. #NOT my_class.instance_eval(@var) my_class.var #using attr_reader So the 'argument' is a block. Does it make any difference at all. What I understand is that by using instance_eval self becomes my_class and one can access the variable. This seems to my much easier that having to add a attr_reader-line-of-code every time one needs to access a variable from outside. But is it practical, in the long run? @Stefano Crocco: With the new example @var none-string works. @Robert Klemme: I can't use Benchmark at the moment. @Phillip Gawlowski: If I'm not mistaken, symblos are NEVER G.collected. That's my concern. Since I'm making dozen of symbols. Also, can you give me a good link on how memory/speed works in computer programming. I use google, but I don't think I'm using the right keywords. Once again: Thank You Very Much. -- Posted via http://www.ruby-forum.com/.