Hi,

sigzero / gmail.com <sigzero / gmail.com> writes:

> 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?

% ruby-1.8.2 -e 'def initialize @msg'
-e:1: formal argument cannot be an instance variable
-e:1: syntax error

Check the line endings.

-- 
eban