From: Randy Kramer Date: 2008-09-20T02:36:09+09:00 Subject: Re: why one array continues to grow after repeated call On Thursday 18 September 2008 05:34 pm, Sebastian Hungerecker wrote: > It accomplishes whatever it has been defined to accomplish. If you do []= > there is no assigment happening unless there's an actual, real assigmnent > in []='s method definition. It's not different from any other method in that > regard. Consider this: > class Foo > def []=(x,y) > # Do nothing at all > end > end > Foo.new[1]=2 # No assigment whatsoever has taken place. > HTH, Sebastien, Thanks, I think it does, but it still doesn't influence me to think of it as a method, or to think it's of any practical difference to an assignment. In C++, I could overload the = operator (I think) to do something different than assignment--if I did, I'd just confuse myself (at least in most circumstances). In Ruby, somebody could make the []= method do something other than assignment, but that would just be confusing (in most circumstances), so I'd try to avoid it. Randy Kramer -- I didn't have time to write a short letter, so I created a video instead.--with apologies to Cicero, et.al.