From: sto.mar@... Date: 2012-06-27T02:31:50+09:00 Subject: Re: Array#sample is Set#sample and not Array#sample ! Am 26.06.2012 18:23, schrieb Michel Demazure: > Bartosz Dziewo��ski wrote in post #1065970: >> 2012/6/25 Robert Klemme : >>> I am sorry, I don't get it. Can you explain what your expectation is? >> >> I think he wants to keep the ordering or original array in the result >> of #sample. >> >> >> This might actually make sense. >> >> -- Matma Rex > > I just mean that array.sample(n) does not depend on the Array 'array' > but of the underlining set. It should be a method of Set. > > For the rest, it is only a question of definition and taste. > _md irb(main):001:0> [1, 1, 1, 1, 2, 3, 4].sample(4) => [1, 1, 1, 2] irb(main):002:0> [1, 1, 1, 1, 2, 3, 4].sample(4) => [4, 1, 1, 2] How would you do that with a set? Regards, Marcus --