Navigation Menu

Skip to content
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

Arrays collapse into scalars with .rotate and the sequence operator in Rakudo #2699

Closed
p6rt opened this issue Apr 4, 2012 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Apr 4, 2012

Migrated from rt.perl.org#112256 (status was 'rejected')

Searchable as RT112256$

@p6rt
Copy link
Author

p6rt commented Apr 4, 2012

From @masak

<TimToady> perl6​: .say for ([1, 0 xx 5-1], *.rotate(-1) ... *)[^5]
<p6eval> niecza v15-6-gefda208​: OUTPUT«1 0 0 0 0␤0 1 0 0 0␤0 0 1 0 0␤0
0 0 1 0␤0 0 0 0 1␤»
<p6eval> ..rakudo 4373f0​: OUTPUT«1 0 0 0 0␤0␤1␤0␤0␤»
<TimToady> um...
<TimToady> rakudobug?
<masak> seemingly.
* masak submits it

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

From @FROGGS

are both wrong now?

<FROGGS> perl6​: .say for ([1, 0 xx 5-1], *.rotate(-1) ... *)[^5]
<p6eval> rakudo bf472b, niecza v22-36-g19fa03a​: OUTPUT«1 0 0 0 0␤0␤1␤0␤0␤»

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 20, 2015

From @perlpilot

On Wed Nov 21 11​:45​:19 2012, FROGGS.de wrote​:

are both wrong now?

<FROGGS> perl6​: .say for ([1, 0 xx 5-1], *.rotate(-1) ... *)[^5]
<p6eval> rakudo bf472b, niecza v22-36-g19fa03a​: OUTPUT«1 0 0 0 0␤0␤1␤0␤0␤»

I think the GLR should fix this as itemizing seems to do the right thing​:

.say for ([1, 0 xx 5-1], *.rotate(-1).item ... *)[^5]
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1

-Scott

@p6rt
Copy link
Author

p6rt commented Sep 15, 2015

From @niner

The working post-GLR version is​:
.say for ($[flat 1, 0 xx 5-1], *.rotate(-1).item ... *)[^5]

I don't see any way this could become simpler without losing features.
http://design.perl6.org/S03.html#line_1925 gives the use case for multiple return values of the generator function as interleaving unrelated sequences. To support that, we have to incorporate multiple values into the return list. Itemization is the way around that.
Thus I'm inclined to reject this ticket.

@p6rt
Copy link
Author

p6rt commented Sep 15, 2015

@niner - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant