Skip Menu |
Report information
Id: 130762
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

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



Subject: Inconsistency in .trans()'s handling of duplicate replacement chars
Download (untitled) / with headers
text/plain 914b
https://irclog.perlgeek.de/perl6/2017-02-11#i_14084570 When duplicate replacement chars are given, the first replacement is used when no named args are present but last (or later?) replacement is used when there are any named args 16:36 IOninja m: say "abc".trans("abc" => "XYZ", :meows) 16:36 camelia rakudo-moar 266f34: OUTPUT«XYZ␤» 16:36 IOninja m: say "abc".trans("aba" => "XYZ", :meows) 16:36 camelia rakudo-moar 266f34: OUTPUT«ZYc␤» 16:36 IOninja m: say "abc".trans("aba" => "XYZ") 16:36 camelia rakudo-moar 266f34: OUTPUT«XYc␤» 16:37 ufobat ha :) 16:38 IOninja ufobat: looks like indeed a bug (inconsistency) on how duplicates are processed between .trans with named args and without. It follows one codepath without any named args and if there are any, changes the replacement to list form and that apparently uses different path for dups 16:38 ufobat should i, will you create a bug report?


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