From: Charles Calvert Date: 2010-11-11T07:05:46+09:00 Subject: Re: the second argument On Fri, 5 Nov 2010 03:10:26 -0500, wroxdb wrote in : > >what's the argument of "obj" in: def []=(index,obj) ? It's the value on the right of the equals sign: a[index] = obj is the same as a.[]=(index, obj) As Jes�s pointed out, Ruby supplies syntactic sugar to allow methods to be called using the syntax of an operator. For example: 5 + 5 is really calling the method "+" on an instance of Fixnum and passing it the value 5 as an argument: 5.+(5) Try it in irb: irb(main):001:0> 5.+(5) => 10 irb(main):002:0> Because operators are really methods, you can define them on your own classes or override them if needed. -- Charles Calvert | Software Design/Development Celtic Wolf, Inc. | Project Management http://www.celticwolf.com/ | Technical Writing (703) 580-0210 | Research