From: Li Chen Date: 2008-09-18T22:27:38+09:00 Subject: Re: why one array continues to grow after repeated call Brian Candler wrote: > Li Chen wrote: >> I expect that once an array is set up it should be fixed regardless how >> many times it is called. > > I'm not sure why you expect that. > > In your program, you first assign @b1 to an empty array. > > In method2, you loop around 4 times pushing '10' onto the end of the > array. Therefore @b1 becomes, each time around the loop, > [10] > [10,10] > [10,10,10] > [10,10,10,10] How come this loop happan? I don't want a loop here. -- Posted via http://www.ruby-forum.com/.