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

Owner: Nobody
Requestors: peschwa [at] gmail.com
Cc:
AdminCc:

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



Subject: [BUG] Match.caps is inconsistent across backends
Download (untitled) / with headers
text/plain 976b
19:57 <psch> j: say ("a" ~~ /<alpha> & <ident> & <alnum>/).caps 19:57 <camelia> rakudo-jvm 5778e8: OUTPUT«ident => 「a」 alnum => 「a」 alpha => 「a」␤» 19:57 <psch> m: say ("a" ~~ /<alpha> & <ident> & <alnum>/).caps 19:57 <camelia> rakudo-moar 5778e8: OUTPUT«alpha => 「a」 ident => 「a」 alnum => 「a」␤» I'm not sure what the correct result would be. S05 mentions that there should be a warning with overlapping bindings. Additionally, sorting of captures is supposed to be by the sub-Matches .from, but it's not clarified what happens to elements with the value for .from. In any case, the current behavior makes at least a few tests S05-capture/caps.t underspecific, e.g. not ok 36 - .caps & - multiple terms# TODO & caps on jvm use of uninitialized value of type Any in string context in sub proclaim at lib/Test.pm:466 # Failed test '.caps & - multiple terms' # at lib/Test.pm line # expected: 'alpha:a|ident:a' # got: 'ident:a|alpha:a'
As of today (2017.11,HEAD(e5b660e)) it prints a *third* variant:

(ident => 「a」 alpha => 「a」 alnum => 「a」)

The change happened in (2017-02-22) https://github.com/rakudo/rakudo/commit/1cafc67b1aad14eafa8d3e6431656524e4d0d5d3

To me it tells that it is just random.


On 2015-03-22 13:02:12, peschwa@gmail.com wrote:
Show quoted text
> 19:57 <psch> j: say ("a" ~~ /<alpha> & <ident> & <alnum>/).caps
> 19:57 <camelia> rakudo-jvm 5778e8: OUTPUT«ident => 「a」 alnum => 「a」
> alpha => 「a」␤»
> 19:57 <psch> m: say ("a" ~~ /<alpha> & <ident> & <alnum>/).caps
> 19:57 <camelia> rakudo-moar 5778e8: OUTPUT«alpha => 「a」 ident => 「a」
> alnum => 「a」␤»
>
> I'm not sure what the correct result would be. S05 mentions that there
> should be a warning with overlapping bindings. Additionally, sorting
> of captures is supposed to be by the sub-Matches .from, but it's not
> clarified what happens to elements with the value for .from. In any
> case, the current behavior makes at least a few tests S05-
> capture/caps.t underspecific, e.g.
>
> not ok 36 - .caps & - multiple terms# TODO & caps on jvm
> use of uninitialized value of type Any in string context in sub
> proclaim at lib/Test.pm:466
>
>
> # Failed test '.caps & - multiple terms'
> # at lib/Test.pm line
> # expected: 'alpha:a|ident:a'
> # got: 'ident:a|alpha:a'




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