Actions
Feature #10444
closed[PATCH 3/3] Vector#[] returns new vector if argument is range.
Feature #10444:
[PATCH 3/3] Vector#[] returns new vector if argument is range.
Description
Files
Actions
Added by gogotanaka (Kazuki Tanaka) almost 12 years ago. Updated over 11 years ago.
Description
Files
| implement_matrix.rb.patch (1.3 KB) implement_matrix.rb.patch | gogotanaka (Kazuki Tanaka), 10/29/2014 08:13 AM | ||
| add_test.patch (820 Bytes) add_test.patch | gogotanaka (Kazuki Tanaka), 10/29/2014 08:13 AM | ||
| update_NEWS.patch (736 Bytes) update_NEWS.patch | gogotanaka (Kazuki Tanaka), 10/29/2014 08:13 AM |
I feel the idea is similar to #10445 (although not as dubious)
I'm curious as to when one would want to do this and actually get a Vector.
@Marc-Andre Lafortune
Thank for reply.
OK, I got your point. Actually I'm not sure anyone want to do this.
But I think there is no reason Vector[1,2,3][0..1] returns not Vector but Array.
thanks.
gogo tanaka wrote:
But I think there is no reason
Vector[1,2,3][0..1]returns notVectorbutArray.
I agree completely, and don't I think it was intended. The doc states "Returns element number +i+" too.
@Marc-Andre Lafortune
OK, it does make sense. Thank you for your time.