On 20.03.2010 13:25, David Vlad wrote:

>  I know what it does, but still it dosnt work.


The behavior of the code you posted is entirely consistent with
the described behavior and the  example in the docs which Ryan posted
(in the example the contents of a are the same before and after calling
collect on it). So if collect does not work for you, show an example in
which it doesn't work (as opposed to one where it behaves exactly as 
expected).

To summarize the important part of the docs: collect returns a *new* array,
it does not change the array it is called on in any way.