New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can(not) assign to List #4499
Comments
From @FROGGSThis feels rather inconsistent: m: my $a = (1, 2, 3); say $a; say $a.WHAT; $a[1] = 42 m: my $a = [1, 2, 3]; say $a = $a[*]; say $a.WHAT; $a[1] = 42; say $a |
From @jnthnOn Wed Sep 02 05:06:50 2015, FROGGS.de wrote:
Here, you have a List of three literal Int objects. And Int is not a container and cannot be assigned to.
Here you have a List of 3 Scalar containers, which happen to contain Ints. Indexing an array has to return its containers, since that's what makes an array element assignable. And that is why you can assign here. It's the same reason that: ($x, $y) = 3, 4; Also works, but: (1, 2) = 3, 4; Does not. |
The RT System itself - Status changed from 'new' to 'open' |
@jnthn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#125963 (status was 'rejected')
Searchable as RT125963$
The text was updated successfully, but these errors were encountered: