-
Notifications
You must be signed in to change notification settings - Fork 1
Writablity of elements of slurpy params depends on given arguments #5939
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
Comments
From @AlexDanielCode: Result (2015.12,2016.06): Result (2016.11,HEAD): The following do not match for other reasons: While it is uncommon, I think the previous result is something one can sanely expect. Bisectable points to rakudo/rakudo@de5d9e7 |
From @zoffixznetThere are two parts to this: 1): I'd expect the new behaviour of HyperWhatever and wouldn't think it's a bug. You get the same with regular Whatever. And in fact, I can argue the 2015.12 version had a bug in it: <Zoffix> committable6, 2015.12 my $x =1; say (--**)($x); say $x The `--` does not affect the value of $x (while on HEAD it does). I can see either behaviour useful. 2): HyperWhatever is just a glorified slurpy sub with `map`, so I played around with some code and found that the reason <Zoffix> committable6, 2015.12 sub { --@_[0] }(1) On some level the above makes sense, however, that behavior changes depending on what *other* args get passed <Zoffix> m: sub { --@_[0] }(1, 1) <Zoffix> m: sub { --@_[0] }(1, [1]) I recall there was a brief discussion about the above but I've no idea what the outcome was. The fact that it's inconsistent with regard to whether or not an arg is writable, based on type of other args, can be a tricky source of bugs and IMO should be made consistent. Cheers, On Thu, 29 Dec 2016 08:55:08 -0800, alex.jakimenko@gmail.com wrote:
|
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetThis seems very related: <Zoffix_> m: sub foo (*@foo) { dd @foo[1] = 42 }; foo <foo bar>; foo |<foo bar>; It actually affects whether values in a created Map are mutable, *depending on how the Map was created*: <Zoffix_> m: dd Map.new(<foo bar>)<foo> = 42 |
Migrated from rt.perl.org#130441 (status was 'open')
Searchable as RT130441$
The text was updated successfully, but these errors were encountered: