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
list repeated once not truncating #3274
Comments
From @finanalystr: my @s=(0,1,0.5,0.4)[^3]; my @t=((0,1,0.5,0.4) xx 1)[^3]; say @s == @t Output should be True ((0,1,0.5,0.4) xx 1) but the latter should be a three element list. I think Richard (finanalyst) |
From @timoMy thoughts on this are as follows: < timotimo> r: .say for ((1, 2, 3) xx 2) since a for loop will evaluate the result of the xx operation in list context and flatten it, and the output of a .perl on it is: < timotimo> r: ((1, 2, 3) xx 2).perl.say the postcircumfix should flatten, too. If you write $(1, 2, 3) xx 2 instead, it should naturally not flatten, just as the for loop wouldn't. |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzHi, On Tue Dec 24 03:15:50 2013, rnhainsworth@gmail.com wrote:
By the current rules (changed during the Great List Refactoring), this is now correct, since @list xx 1 produces a one-element list, and subscripting with [^3] doesn't flatten anymore. Cheers, |
@moritz - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#120861 (status was 'rejected')
Searchable as RT120861$
The text was updated successfully, but these errors were encountered: