Open p6rt opened 7 years ago
Code: say (--**)(1,2,3,4,5)
Result (2015.12,2016.06): (0 1 2 3 4)
Result (2016.11,HEAD): Cannot resolve caller prefix:\<-->(Int); the following candidates match the type but require mutable arguments: (Mu:D $a is rw) (Int:D $a is rw)
The following do not match for other reasons:
(Bool $a is rw)
(Mu:U $a is rw)
(Num:D $a is rw)
(Num:U $a is rw)
(int $a is rw)
(num $a is rw --> num)
in block \
While it is uncommon, I think the previous result is something one can sanely expect.
Bisectable points to https://github.com/rakudo/rakudo/commit/de5d9e70cbfe678d2371d284e9384f53aba1eb94
There 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:
\
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 hyperwhatevers in the past did not affect $x is because slurpies "detached", or "debinded", or whatever you wanna call it, the given args and the contents of the slurpie had writable containers:
\
\
On some level the above makes sense, however, that behavior changes depending on what *other* args get passed to the slurpie. For example, if we add an extra Int, it still cries about non-writable thing for prefix:\<-->, but if the *extra* arg is, for example, an array, then the *first* argument suddenly receives a writable container for itself.
\
\
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, ZZ
On Thu, 29 Dec 2016 08:55:08 -0800, alex.jakimenko@gmail.com wrote:
Code: say (--**)(1,2,3,4,5)
Result (2015.12,2016.06): (0 1 2 3 4)
Result (2016.11,HEAD): Cannot resolve caller prefix:\<-->(Int); the following candidates match the type but require mutable arguments: (Mu:D $a is rw) (Int:D $a is rw)
The following do not match for other reasons: (Bool $a is rw) (Mu:U $a is rw) (Num:D $a is rw) (Num:U $a is rw) (int $a is rw) (num $a is rw --> num) in block \
at /tmp/DOB7M3C38w line 1 While it is uncommon, I think the previous result is something one can sanely expect.
Bisectable points to https://github.com/rakudo/rakudo/commit/de5d9e70cbfe678d2371d284e9384f53aba1eb94
The RT System itself - Status changed from 'new' to 'open'
This seems very related:
\<Zoffix_> m: sub foo (*@foo) { dd @foo[1] = 42 }; foo \
It actually affects whether values in a created Map are mutable, *depending on how the Map was created*:
\<Zoffix_> m: dd Map.new(\
Migrated from rt.perl.org#130441 (status was 'open')
Searchable as RT130441$