develooper Front page | perl.perl6.compiler | Postings from February 2012

[perl #109672] [BUG] <!> in regexes doesn't fail in Rakudo

From:
Carl Mäsak
Date:
February 2, 2012 07:58
Subject:
[perl #109672] [BUG] <!> in regexes doesn't fail in Rakudo
Message ID:
rt-3.6.HEAD-14510-1328198285-1909.109672-82-0@perl.org
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #109672]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109672 >


<skids> rakudo: say "aaa" ~~ m/ a [ a <!> ]? a /;
<p6eval> rakudo ce5cca: OUTPUT«=> <aaa>␤␤»
<skids> Which is correct, of course.
<skids> (I think?)
<skids> wait, shouldn't that above response be "aa" not "aaa"?
<moritz> you're right
<moritz> nom: say so 'a' ~~ /<!>/
<p6eval> nom ce5cca: OUTPUT«True␤»
<moritz> oh
<moritz> it seems that <!> doesn't work :/
<skids> Well, it has to work in some sense, because I'm using it
effectively elsewhere I think.
<moritz> if it worked, the above would have said 'False' and not 'True'
<TimToady> nom: say so 'a' ~~ /<!{1}>/
<p6eval> nom ce5cca: OUTPUT«False␤»
<TimToady> nom: say so 'a' ~~ /<!{0}>/
<p6eval> nom ce5cca: OUTPUT«True␤»
* masak submits rakudobug

The last two evaluations are correct, AFAIK. The first two should
yield "aa", and "False".



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About