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

Z, doesn't flatten its parcels in list context as does Z in Rakudo #1646

Closed
p6rt opened this issue Apr 1, 2010 · 8 comments
Closed

Z, doesn't flatten its parcels in list context as does Z in Rakudo #1646

p6rt opened this issue Apr 1, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Apr 1, 2010

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

Searchable as RT73948$

@p6rt
Copy link
Author

p6rt commented Apr 1, 2010

From @masak

<moritz_> is Z, the same as Z (as an infix operator)?
<jnthn> Think so.
<moritz_> rakudo​: say <a b c> Z, <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a 1b 2c 3␤»
<jnthn> rakudo​: say <a b c> Z <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a1b2c3␤»
<moritz_> rakudo​: say (<a b c> Z, <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«(("a", "1"), ("b", "2"), ("c", "3"))␤»
* masak smells a bug
<moritz_> well, I think the parcels should flatten in list context
<colomon> rakudo​: say (<a b c> Z <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«("a", "1", "b", "2", "c", "3")␤»
<jnthn> aye
<colomon> I think we still have flattening issues...
<jnthn> EOUTOFSTEAMROLLERS
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Apr 1, 2010

From @markjreed

Per S03, the fact that Z flattens is a bug, one that I submitted as
such. Am I reading something wrong or is the spec out of date? Don't
emulate Z's behavior for Z, if it's incorrect.

On Thursday, April 1, 2010, Carl Mäsak <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by  "Carl Mäsak"
# Please include the string​:  [perl #​73948]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=73948 >

<moritz_> is Z, the same as Z (as an infix operator)?
<jnthn> Think so.
<moritz_> rakudo​: say <a b c> Z, <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a 1b 2c 3␤»
<jnthn> rakudo​: say <a b c> Z <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a1b2c3␤»
<moritz_> rakudo​: say (<a b c> Z, <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«(("a", "1"), ("b", "2"), ("c", "3"))␤»
* masak smells a bug
<moritz_> well, I think the parcels should flatten in list context
<colomon> rakudo​: say (<a b c> Z <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«("a", "1", "b", "2", "c", "3")␤»
<jnthn> aye
<colomon> I think we still have flattening issues...
<jnthn> EOUTOFSTEAMROLLERS
* masak submits rakudobug

--
Mark J. Reed <markjreed@​gmail.com>

@p6rt
Copy link
Author

p6rt commented Apr 1, 2010

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

@p6rt
Copy link
Author

p6rt commented Apr 1, 2010

From @moritz

Mark J. Reed wrote​:

Per S03, the fact that Z flattens is a bug, one that I submitted as
such. Am I reading something wrong or is the spec out of date? Don't
emulate Z's behavior for Z, if it's incorrect.

The fact that list context doesn't flatten parcels is wrong - so
whatever Rakudo's infix​:<Z> does is wrong.

On Thursday, April 1, 2010, Carl Mäsak <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​73948]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=73948 >

<moritz_> is Z, the same as Z (as an infix operator)?
<jnthn> Think so.
<moritz_> rakudo​: say <a b c> Z, <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a 1b 2c 3␤»
<jnthn> rakudo​: say <a b c> Z <1 2 3>
<p6eval> rakudo 0dcfc6​: OUTPUT«a1b2c3␤»
<moritz_> rakudo​: say (<a b c> Z, <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«(("a", "1"), ("b", "2"), ("c", "3"))␤»
* masak smells a bug
<moritz_> well, I think the parcels should flatten in list context
<colomon> rakudo​: say (<a b c> Z <1 2 3>).perl
<p6eval> rakudo 0dcfc6​: OUTPUT«("a", "1", "b", "2", "c", "3")␤»
<jnthn> aye
<colomon> I think we still have flattening issues...
<jnthn> EOUTOFSTEAMROLLERS
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Dec 5, 2010

From @mathw

As far as I read from S03, infix​:<Z> is just a shorthand for
infix​:<Z,>. However, in Rakudo infix​:<Z> produces a flattened output
list, while infix​:<Z,> doesn't.

say (1, 2 Z 3, 4).perl
(1, 3, 2, 4)
say (1, 2 Z, 3, 4).perl
((1, 3), (2, 4))

S03 makes it clear to me that the non-flattened output is the correct
one, with examples like​:

1,2 Z 3,4 # (1,3),(2,4)

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

On Sun Dec 05 01​:10​:21 2010, matt-w wrote​:

As far as I read from S03, infix​:<Z> is just a shorthand for
infix​:<Z,>. However, in Rakudo infix​:<Z> produces a flattened output
list, while infix​:<Z,> doesn't.

say (1, 2 Z 3, 4).perl
(1, 3, 2, 4)
say (1, 2 Z, 3, 4).perl
((1, 3), (2, 4))

S03 makes it clear to me that the non-flattened output is the correct
one, with examples like​:

1,2 Z 3,4 # (1,3),(2,4)

This seems correct now. marking testneeded.

15​:30 <diakopter> r​: say (1, 2 Z 3, 4).perl
15​:30 <p6eval> rakudo 3b1596​: OUTPUT«((1, 3), (2, 4)).list␤»

@p6rt
Copy link
Author

p6rt commented Nov 18, 2012

From @moritz

Now tested in S03-metaops/zip.t

@p6rt
Copy link
Author

p6rt commented Nov 18, 2012

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

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