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

SEQUENCE xx N does not preserve structure #4733

Closed
p6rt opened this issue Nov 6, 2015 · 4 comments
Closed

SEQUENCE xx N does not preserve structure #4733

p6rt opened this issue Nov 6, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 6, 2015

Migrated from rt.perl.org#126576 (status was 'resolved')

Searchable as RT126576$

@p6rt
Copy link
Author

p6rt commented Nov 6, 2015

From @smls

When the LHS expression of xx is a List, the nested structure of the
result is preserved​:

  ➜ dd (2, 4, 6) xx 2
  List $var = $((2, 4, 6), (2, 4, 6))

However when the LHS is a Seq returned from .pick or .map or similar, the
result unexpectedly gets flattened​:

  ➜ dd (2, 4, 6).pick(*) xx 2
  List $var = $(2, 6, 4, 4, 2, 6)

  ➜ dd (2, 4, 6).map({$_}) xx 2
  List $var = $(2, 4, 6, 2, 4, 6)

[This is perl6 version 2015.10-195-ga2a34c2 built on MoarVM version 2015.10-56-g9fd3005]

@p6rt
Copy link
Author

p6rt commented Dec 15, 2015

From @jnthn

On Thu Nov 05 23​:02​:55 2015, smls75@​gmail.com wrote​:

When the LHS expression of xx is a List, the nested structure of the
result is preserved​:

➜ dd (2, 4, 6) xx 2
List $var = $((2, 4, 6), (2, 4, 6))

However when the LHS is a Seq returned from .pick or .map or similar,
the
result unexpectedly gets flattened​:

➜ dd (2, 4, 6).pick(*) xx 2
List $var = $(2, 6, 4, 4, 2, 6)

➜ dd (2, 4, 6).map({$_}) xx 2
List $var = $(2, 4, 6, 2, 4, 6)

[This is perl6 version 2015.10-195-ga2a34c2 built on MoarVM version
2015.10-56-g9fd3005]

It should retain structure even with a Seq. Fixed and tests in S03-operators/repeat.t.

@p6rt
Copy link
Author

p6rt commented Dec 15, 2015

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

@p6rt
Copy link
Author

p6rt commented Dec 15, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Dec 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant