From: Matt Armstrong Date: 2001-11-30T09:58:17+09:00 Subject: [ruby-talk:27008] Re: Why use symbols (was: Can this be factored?) "Mark Hahn" writes: > I've never processed symbols before. If I have an object and a symbol of an > instance variable, do I have to use eval to access the value, or is there a > faster way? Object#send > def printSide obj, side > puts eval("obj."+side.id2name) > end > printSide(node,:left) Try: def printSide(obj, side) puts obs.send(side) end -- matt