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

bug in the product iterator #1437

Closed
ghost opened this issue Oct 24, 2012 · 0 comments
Closed

bug in the product iterator #1437

ghost opened this issue Oct 24, 2012 · 0 comments
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@ghost
Copy link

ghost commented Oct 24, 2012

I'm not completely sure if this is intended, but product from Iterators.product currently has the following behavior:

First up, the nice case:

for i in product(1:3,1:2); println(i); end
(1,1)
(2,1)
(3,1)
(1,2)
(2,2)
(3,2)

However, suppose we switch the second argument to a single element:

for i in product(1:3,1); println(i); end
(1,1)
(2,1)
(3,1)
(1,1)
(2,1)
(3,1)

Are the repeated elements desired here? A singleton in the first argument produces an even more interesting result:

for i in product(1,1:3); println(i); end
(1,1)
(1,1)
(1,2)
(1,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant