From: Andreas Semt Date: 2005-01-24T23:52:00+09:00 Subject: Re: This is wierd... sigzero@gmail.com wrote: > I just installed 1.8.2 to get a feel for Ruby. I tried the hello.rb > file. > > This works: > class Hello > > attr_reader :msg > > def initialize > > @msg = "Hello, World" > > end > > end > > h = Hello.new > > puts h.msg > > print "Press RETURN" > > $stdin.gets > > This does not: > > class Hello > attr_reader :msg > > def initialize > @msg = "Hello, World" > end > end > > h = Hello.new > puts h.msg > print "Press RETURN" > $stdin.gets > > hello.rb:2: formal argument cannot be an instance variable > It is the same code except the spacing. What is the deal? > > Robert > > > > Hello Robert! i am on W2K Pro, Ruby: ruby 1.8.2 (2004-07-29) [i386-mswin32]. Both versions of your code works for me. Greetings, Andreas