On 2017-12-28 14:27:31, AARONRP wrote:
Show quoted text> The "get" method of the native array trait allows only one value at a
> time to be returned. It would be nice if there were a "slice" method
> that allowed several values by index to be returned. Or,
> alternatively, extend the "get" method to accept multiple values.
>
> Perhaps not the _most_ important issue ever, but it seemed like an odd
> omission.
>
> And in general, thanks for Moose, it's really helpful!
I think some sort of "multi-get" operation could make sense. We wouldn't want to extend the existing "get" because that leads to context issues like this:
Foo->new( size => $obj->get(1, 2) ); # list context
So we'd want a new method that is documented to always potentially return a list.
Separately, I also note that we don't offer a wrapper for Perl's built-in "slice", which seems like an omission. But you wouldn't want to use it for multi-get, since it also allows mutation of the array.