Skip Menu |
Report information
Id: 116010
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] something goes wrong with loose postfixes in Rakudo
Date: Fri, 7 Dec 2012 11:55:27 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 1.1k
<masak> rn: sub postfix:<+>($a) is looser(&infix:<+>) { $a; 77 }; say +6+ +8+ <p6eval> rakudo 53daef: OUTPUT«83␤» <p6eval> ..niecza v24-5-g599cbcb: OUTPUT«77␤» <masak> hah! <diakopter> :D <diakopter> masak wins * masak submits rakudobug <moritz> should be 77 <masak> then Niecza is right. <moritz> in case of no spaces, postfix wins over infix <jnthn> 6+ trigers the postfix <masak> so does 8+ <jnthn> So we get 77 <masak> oh, I see what you mean. <jnthn> We look for an infix next <jnthn> grr, this is hard to think about :P * moritz still isn't convinced <moritz> how is this beast parsed? * masak grins <jnthn> Well, I can see what's going on easy enough up to the final postfix. <moritz> ((+6)+ + (+8))+ <moritz> that's how I'd expect it <moritz> and I guess that niecza does it that way <masak> right. <masak> and gets 77. <moritz> since the final postfix is looser than the infix, I'd argue that's correct <masak> I can get behind that. <masak> so, rakudobug. <masak> moritz: no, (((+6)+) + 8)+ <masak> there are only two pluses between the 6 and the 8. <masak> so the second one must be an infix. <moritz> right <moritz> but still,the result should be 77 <masak> aye.
Still not 77.
On 2012-12-07 02:55:44, masak wrote:
Show quoted text
> <masak> rn: sub postfix:<+>($a) is looser(&infix:<+>) { $a; 77 }; say
> +6+ +8+
> <p6eval> rakudo 53daef: OUTPUT«83␤»
> <p6eval> ..niecza v24-5-g599cbcb: OUTPUT«77␤»
> <masak> hah!
> <diakopter> :D
> <diakopter> masak wins
> * masak submits rakudobug
> <moritz> should be 77
> <masak> then Niecza is right.
> <moritz> in case of no spaces, postfix wins over infix
> <jnthn> 6+ trigers the postfix
> <masak> so does 8+
> <jnthn> So we get 77
> <masak> oh, I see what you mean.
> <jnthn> We look for an infix next
> <jnthn> grr, this is hard to think about :P
> * moritz still isn't convinced
> <moritz> how is this beast parsed?
> * masak grins
> <jnthn> Well, I can see what's going on easy enough up to the final
> postfix.
> <moritz> ((+6)+ + (+8))+
> <moritz> that's how I'd expect it
> <moritz> and I guess that niecza does it that way
> <masak> right.
> <masak> and gets 77.
> <moritz> since the final postfix is looser than the infix, I'd argue
> that's correct
> <masak> I can get behind that.
> <masak> so, rakudobug.
> <masak> moritz: no, (((+6)+) + 8)+
> <masak> there are only two pluses between the 6 and the 8.
> <masak> so the second one must be an infix.
> <moritz> right
> <moritz> but still,the result should be 77
> <masak> aye.




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