From: "Florian Groß" Date: 2005-05-06T08:47:31+09:00 Subject: [BUG?] Array#slice!() adds elements to Array Moin. The following behavior is undocumented and IMHO counter-intuitive and of little use: # Limit an array to three elements irb(main):001:0> obj = [1]; obj.slice!(3 .. -1); obj => [1, nil, nil] I've always thought about .slice!() as a good way of truncating. The above conflicts with that use of the method. Note that I am okay with having that behavior for obj[3 .. -1] = [] so it would still be reachable in case anybody finds it useful. If that is too long I think it would also be okay to add Array#size= for that case. If you think that the above makes sense the documentation should still be updated to point out that case and I think it would be a good idea to add a method for truncating arrays in that case. Kind regards, Florian Gross