New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.trans different behavior for Str Pairs versus List Pairs #5635
Comments
From @zostayFrom #perl6 today: 21:42:01 <zostay> m: say "test.foo".trans('.' => '::'); This appears to be documented as a feature in the spec tests, but is not Assuming my quick read of the spec is correct, I propose either of the 1. Change the spec and make the behavior between the two calling styles 2. Fix the documentation on docs.perl6.org AND modify the Str => Str |
From @lizmatI would suggest 2, as the [] => [] way exists exactly for the reason that you think it’s a bug: when you want to translate a single char into zero or more chars.
|
The RT System itself - Status changed from 'new' to 'open' |
From @skidsTurns out there is actually a (possibly bug) difference in behavior here: (02:58:53 AM) skids: m: my $str = "abcdabcd"; $str.trans("abc" => "AB").say; $str.say; Other things I noted while looking at roast to see what was tested behavior: is("abcde".trans( ('a..e' => 'A'..'E') ), "ABCDE", is(" <>&".trans( ([' ', '<', '>', '&'] => is(" <>&".trans( ([' ', ' <', '<', '>', '&'] => As to the original ticket subject matter, I'm not sure warning is a good idea for two reasons: 1) it's complicated logic to figure out if the target Str contains ranges longer than needed |
Migrated from rt.perl.org#129172 (status was 'open')
Searchable as RT129172$
The text was updated successfully, but these errors were encountered: