From: benny Date: 2005-02-08T01:55:08+09:00 Subject: Re: How come this doesn't work as expected? Chris Gehlker wrote: > I get your points. My question was how come the assignment back to > testAry doesn't replace it with an array of numbers. Here is a > different version of the program which may highlight the problem. > > testAry = ["5", "7", "9"] > p testAry > numAry = testAry.each { |n| n.to_i} > p numAry testAry = ["5", "7", "9"] p testAry numAry = testAry.collect { |n| n.to_i} p numAry does what you expect. each only iterates over the array. benny -- --------------------------------------------------------------------------------------------------- Don't crash when a filter changes the subject of a message which results in the attempt to remove it from the tree of subject threading messages failing and the detached child looking for a new parent finding the old parent as the new parent, which in turn results in the child being deleted with the old (and new) parent, which is not a good idea, since it is still referenced. (Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)