Open p6rt opened 9 years ago
19:43 \< psch> m: say ("a" ~~ /(.) | ./); say ("a" ~~ /(.) & ./)
19:43 \<+camelia> rakudo-moar 5778e8: OUTPUT«「a」 0 => 「a」「a」 => 「a」»
19:43 \< psch> the mysterious case of the disappearing 0
19:43 \< FROGGS> O.o
19:44 \< Mouq> m: say ("a" ~~ /. & (.)/)
[...]
19:44 \<+camelia> rakudo-moar 5778e8: OUTPUT«「a」 => 「a」»
19:44 \< psch> nothing up my sleeve!
19:44 \< FROGGS> m: say ("a" ~~ /(.) | ./); $/ := Nil; say ("a" ~~ /(.) & ./)
19:44 \<+camelia> rakudo-moar 5778e8: OUTPUT«「a」 0 => 「a」Cannot assign to an immutable value in method ACCEPTS at src/gen/m-CORE.setting:16293 in block \
19:54 \
The behavior is different now on Rakudo 2016.04-210-gc59e4dc.
The procedural version (&&) seems to handle captures correctly now:
➜ say "a" ~~ / . && (.)/; # 「a」 0 => 「a」 ➜ say "a" ~~ /(.) && . /; # 「a」 0 => 「a」 ➜ say "a" ~~ /(.) && (.)/; # 「a」 0 => 「a」 1 => 「a」
However, the declarative version (&) does not seem to remember its captures at all:
➜ say "a" ~~ / . & (.)/; # 「a」 ➜ say "a" ~~ /(.) & . /; # 「a」 ➜ say "a" ~~ /(.) & (.)/; # 「a」
The RT System itself - Status changed from 'new' to 'open'
Migrated from rt.perl.org#124149 (status was 'open')
Searchable as RT124149$