# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #79270] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=79270 >
<masak> rakudo: my @a = <a b c>; @a[0 ..^ *-1] >>~=>> "\n"; say @a.perl <p6eval> rakudo 015d77: OUTPUT«(timeout)» * masak submits rakudobug <colomon> rakudobug for that? <masak> colomon: locally, I get a stack overflow. <colomon> but do you think it is correct? <colomon> you're mixing positional whatever with range whatever <masak> oh, I can't do that? <colomon> probably shouldn't stack overflow, but... <masak> I totally thought I could. <masak> it feels so natural. <masak> rakudo: my @a = <a b c>; @a[0 ..^ *-1] <p6eval> rakudo 015d77: OUTPUT«(timeout)» <colomon> well, do you know if it is (0 ..^ *) - 1 or 0 ..^ (*-1) (for starters)? <masak> I'm assuming the latter, for precedence reasons. <colomon> and if it is the later, you're making a Range with an Int on one side and a closure on the other <masak> so? <masak> that's what WhateverCode is; a closure. <masak> I don't see the fundamental difference to ordinary ranging with Whatever. <colomon> ranges don't participate in WhateverCode, do they? <masak> I don't know. <colomon> Certainly 1..* does not generate a closure <masak> S09:245 has @array[0 .. *-1] as an example of valid slicings. <colomon> (It does look like it should parse as 0..(*-1)) <jnthn> masak: In [0..*-1] the *-1 would...yes, that. :) <masak> jnthn: that's what I expected. <masak> or rather, I don't care much how it works implementation-wise (as long as it works), but that was the precedence I assumed. <colomon> "For any prefix, postfix, or infix operator that would be curried by a Whatever, a WhateverCode also autocurries it" <colomon> to me, that pretty explicitly leaves out the 0..*-1 case <masak> colomon: even though S09 says it should work? <colomon> masak: the spec is known to have errors <masak> colomon: but it would *suck* if this didn't work! <masak> colomon: and TimToady wrote that part of S09, so it's not like it's untrustworthy because of many chefs. <colomon> personally, I'm not seeing any reason to have the above quote... it seems like anything hit with a WhateverCode could curry. <colomon> masak: TimToady++ is a genius, but he does make mistakes. <masak> colomon: well, what I'm saying doesn't depend on TimToady not making mistakes. it depends on what feels right from a user perspective. <masak> and if I won't be able to write [0 .. *-1], I'll fork and make my own Perl 6. <jnthn> .oO( Who'd be less tormenting to the implementer... ) <colomon> Look, I don't see any obvious harm in allowing that. But presumably the specquote is there for a reason which I do not understand.