Skip Menu |
Report information
Id: 114276
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Cannot return junctions from .classify blocks in Rakudo
Date: Thu, 26 Jul 2012 15:11:57 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 993b
<felher> And now for something completely different: <felher> r: say [[1,2,0]].classify: -> $rpn { $rpn eqv [1,2,0]|[2,0,1] }; <p6eval> rakudo ed269f: OUTPUT«Cannot assign to a readonly variable or a value [...] <moritz> r: say [1,2,0] eqv [1,2,0]|[2,0,1] <p6eval> rakudo ed269f: OUTPUT«any(True, False)␤» <moritz> felher: ah, might be easy to fix <moritz> maybe just some variable that needs a Mu type instead of Any <felher> :) * masak submits rakudobug <masak> r: say [[1,2,0]].classify: -> $rpn { $rpn eqv [1,2,0] } <p6eval> rakudo ed269f: OUTPUT«True 1 2 0␤» <masak> r: say [1,2,3,4,5].classify: -> $rpn { $rpn eqv 1|3 } <p6eval> rakudo ed269f: OUTPUT«Cannot assign to a readonly variable or a value [...] <moritz> r: say (1, 2).classify: -> $x { 1|2 } <p6eval> rakudo ed269f: OUTPUT«Cannot assign to a readonly variable or a value [...] <masak> moritz++ <masak> it's probably returning the junction out of the .classify block that causes trouble. <moritz> masak: correct
What behavior do you expect? I can only fix it if I know what it should look like after the fix :-)
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 559b
On Tue Aug 07 03:36:11 2012, moritz wrote: Show quoted text
> What behavior do you expect? I can only fix it if I know what it should > look like after the fix :-)
The immediate expectation is for the error "Cannot assign to a readonly variable or a value" not to occur. That's the observable -- sorry for being less-than-clear on that. :) Then again, I see the problem in deciding what should happen. The conservative thing would be to have .classify barf on junctions as keys. Or -- if it makes sense -- have the junction be stringified and use the string as the key.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 246b
Current failure mode: $ perl6-m -e 'say (1, 2).classify: -> $x { 1|2 }' P6opaque: no such attribute '$!reified' in block <unit> at -e:1 $ perl6-m --version This is perl6 version 2015.09-431-g5d83db3 built on MoarVM version 2015.09-79-gee9fc2b
Download (untitled) / with headers
text/plain 543b
On Tue, 20 Oct 2015 23:06:02 -0700, bartolin@gmx.de wrote: Show quoted text
> Current failure mode: > > $ perl6-m -e 'say (1, 2).classify: -> $x { 1|2 }' > P6opaque: no such attribute '$!reified' > in block <unit> at -e:1 > > $ perl6-m --version > This is perl6 version 2015.09-431-g5d83db3 built on MoarVM version > 2015.09-79-gee9fc2b
Things have changed yet again: $ perl6-m -e 'say (1, 2).classify: -> $x { 1|2 }' {1 => [1 2], 2 => [1 2]} $ perl6-m -v This is Rakudo version 2018.06-24-gc441d8d built on MoarVM version 2018.06 implementing Perl 6.c.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org