From: Cary Swoveland Date: 2010-01-20T07:42:42+09:00 Subject: Re: Newbie needs help getting started Marnen Laibow-Koser wrote: ... >> I expected >> n = 0 >> but instead, Ruby says >> n = # >> ? > > Why would you expect n to be 0 when you're assigning the actual Node > object to n? It would have helped if I didn't mis-write my little example. What I meant to write was: class Node attr_reader :row def initialize(r) row = r end end n = Node.new(0) puts "n.row = #{n.row}" After reading the other replies, I see my error was in line 4: rather than row = r I needed @row =r I get it, though I don't know why attr_reader :row is not be written attr_reader :@row but I do note that the latter produces an error. Thanks, all. Cary -- Posted via http://www.ruby-forum.com/.