Actions
Feature #10444
closed[PATCH 3/3] Vector#[] returns new vector if argument is range.
Description
Hi, it's incompatible change little bit.
Before
Vector[1,2,3][0..1]
=> [1, 2]
After
Vector[1,2,3][0..1]
=> Vector[1, 2]
I'm not in a hurry. Take your time.
Files
Updated by marcandre (Marc-Andre Lafortune) about 10 years ago
- Status changed from Open to Feedback
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.
Updated by gogotanaka (Kazuki Tanaka) about 10 years ago
@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.
Updated by marcandre (Marc-Andre Lafortune) about 10 years ago
- Status changed from Feedback to Rejected
gogo tanaka wrote:
But I think there is no reason
Vector[1,2,3][0..1]
returns notVector
butArray
.
I agree completely, and don't I think it was intended. The doc states "Returns element number +i+" too.
Updated by gogotanaka (Kazuki Tanaka) about 10 years ago
@Marc-Andre Lafortune
OK, it does make sense. Thank you for your time.
Actions
Like0
Like0Like0Like0Like0