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

Nested triangular reduce produces empty list #1877

Closed
p6rt opened this issue Jun 26, 2010 · 9 comments
Closed

Nested triangular reduce produces empty list #1877

p6rt opened this issue Jun 26, 2010 · 9 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 26, 2010

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

Searchable as RT76110$

@p6rt
Copy link
Author

p6rt commented Jun 26, 2010

From @moritz

09​:33 < tylercurtis> rakudo​: say [\+] [\+] 1 xx 5
09​:33 < p6eval> rakudo ea8f2b​: ( no output )

doesn't work :(

09​:33 < tylercurtis> pugs​: say [\+] [\+] 1 xx 5
09​:33 < p6eval> pugs​: OUTPUT«1361015␤»

Yep, pugs gets it right

09​:35 <@​moritz_> rakudo​: say ([\+] 1 xx 5).perl
09​:35 < p6eval> rakudo ea8f2b​: OUTPUT«(1, 2, 3, 4, 5)␤»

first one still works...

09​:35 <@​moritz_> rakudo​: say ([\+] ([\+] 1 xx 5)).perl
09​:35 < p6eval> rakudo ea8f2b​: OUTPUT«()␤»

Nesting doesn't. Doesn't seem to be a precedence problem.

09​:36 < tylercurtis> rakudo​: say ([\+] [[\+] 1 xx 5])
09​:36 < p6eval> rakudo ea8f2b​: OUTPUT«1361015␤»

Aha. over-eager argument flattening somewhere?

--
Moritz Lenz
http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

@p6rt
Copy link
Author

p6rt commented Jul 6, 2010

From @masak

<masak> rakudo​: say [+] [1,2,3] # bug courtesy of TimToady++
<p6eval> rakudo 04a918​: OUTPUT«6␤»
* masak submits rakudobug
<masak> <TimToady> [] should never flatten in a listop
<moritz_> masak​: the [+] [1, 2, 3] bug might be related to
http://rt.perl.org/rt3/Ticket/Display.html?id=76110
* masak looks
<masak> the final question seems to indicate it is.
<masak> but I don't immediately see the connection.
<moritz_> the connection is that [...] around the inner expression make it work
<masak> right.
<masak> I'll put this issue in that ticket, then.

@p6rt
Copy link
Author

p6rt commented Jul 6, 2010

From [Unknown Contact. See original ticket]

<masak> rakudo​: say [+] [1,2,3] # bug courtesy of TimToady++
<p6eval> rakudo 04a918​: OUTPUT«6␤»
* masak submits rakudobug
<masak> <TimToady> [] should never flatten in a listop
<moritz_> masak​: the [+] [1, 2, 3] bug might be related to
http://rt.perl.org/rt3/Ticket/Display.html?id=76110
* masak looks
<masak> the final question seems to indicate it is.
<masak> but I don't immediately see the connection.
<moritz_> the connection is that [...] around the inner expression make it work
<masak> right.
<masak> I'll put this issue in that ticket, then.

@p6rt
Copy link
Author

p6rt commented Jul 6, 2010

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 31, 2011

From @coke

On Sat Jun 26 00​:44​:28 2010, mlenz@​physik.uni-wuerzburg.de wrote​:

09​:33 < tylercurtis> rakudo​: say [\+] [\+] 1 xx 5
09​:33 < p6eval> rakudo ea8f2b​: ( no output )

doesn't work :(

09​:33 < tylercurtis> pugs​: say [\+] [\+] 1 xx 5
09​:33 < p6eval> pugs​: OUTPUT«1361015␤»

Yep, pugs gets it right

And rakudo does too, now​:

say [\+] [\+] 1 xx 5
1361015

09​:35 <@​moritz_> rakudo​: say ([\+] 1 xx 5).perl
09​:35 < p6eval> rakudo ea8f2b​: OUTPUT«(1, 2, 3, 4, 5)␤»

first one still works...

09​:35 <@​moritz_> rakudo​: say ([\+] ([\+] 1 xx 5)).perl
09​:35 < p6eval> rakudo ea8f2b​: OUTPUT«()␤»

Nesting doesn't. Doesn't seem to be a precedence problem.

say ([\+] ([\+] 1 xx 5)).perl
(1, 3, 6, 10, 15)

09​:36 < tylercurtis> rakudo​: say ([\+] [[\+] 1 xx 5])
09​:36 < p6eval> rakudo ea8f2b​: OUTPUT«1361015␤»

Aha. over-eager argument flattening somewhere?

These all work now. Just need tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 31, 2011

From @coke

On Tue Jul 06 04​:44​:22 2010, masak wrote​:

<masak> rakudo​: say [+] [1,2,3] # bug courtesy of TimToady++
<p6eval> rakudo 04a918​: OUTPUT«6␤»
* masak submits rakudobug
<masak> <TimToady> [] should never flatten in a listop

Answer's changed. (Is it right? Dunno).

say [+] [1,2,3]
3

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 31, 2011

From @coke

On Mon, Jan 31, 2011 at 2​:10 AM, Will Coleda via RT
<perl6-bugs-followup@​perl.org> wrote​:

On Tue Jul 06 04​:44​:22 2010, masak wrote​:

<masak> rakudo​: say [+] [1,2,3] # bug courtesy of TimToady++
<p6eval> rakudo 04a918​: OUTPUT«6␤»
* masak submits rakudobug
<masak> <TimToady> [] should never flatten in a listop

Answer's changed. (Is it right? Dunno).

09​:36 < pmichaud> [Coke]​: Rakudo is correct
09​:36 < moritz_> [Coke]​: 3 is correct I think

say [+] [1,2,3]
3

So, just needs tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 31, 2011

From @moritz

Tested in S03-metaops/reduce.t.

moritz

@p6rt
Copy link
Author

p6rt commented Jan 31, 2011

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

@p6rt p6rt closed this as completed Jan 31, 2011
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant