Patches item #1469, was opened at 2005-02-07 08:40
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=1469&group_id=426

Category: Ruby1.8
>Group: v1.8.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Sam Roberts (sam)
Assigned to: Nobody (None)
>Summary:  [doc patch->object.c] instance_variable_set will create an instance var

Initial Comment:
This wasn't clear from the docs, or the example, but I tried it:
        
$ irb < ivarset.rb
>> class Fred
>>   def initialize(p1, p2)
>>     @a, @b = p1, p2
>>   end
>> end
=> nil
>> fred = Fred.new('cat', 99)
=> #<Fred:0x2fd764 @a="cat", @b=99>
>> fred.instance_variable_set(:@a, 'dog')
=> "dog"
>> fred.instance_variable_set(:@c, 'cat')
=> "cat"
>> fred.inspect
=> "#<Fred:0x2fd764 @a=\dog\, @b=99, @c=\cat\>" 
>>


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=1469&group_id=426