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

Zip and ranges don't mix #435

Closed
p6rt opened this issue Nov 28, 2008 · 6 comments
Closed

Zip and ranges don't mix #435

p6rt opened this issue Nov 28, 2008 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Nov 28, 2008

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

Searchable as RT60898$

@p6rt
Copy link
Author

p6rt commented Nov 28, 2008

From @moritz

10​:04 < moritz_> rakudo​: say (<a b c> Z 1..10).perl
10​:05 < p6eval> rakudo 33300​: OUTPUT[elements() not implemented in class
'Range'#current instr.​: 'infix​:Z' pc 4039 (src/gen_builtins.pir​:2555)#]
10​:05 < moritz_> rakudo​: say (<a b c> Z list(1..10)).perl
10​:05 < p6eval> rakudo 33300​: OUTPUT[["a", 1, "b", 2, "c", 3]#]

So infix​:<Z> doesn't seem to like Range objects

(sorry, the copy & paste substituted the newline character with #, I'm on an
UTF-8 deprived terminal rights now :-/ )

@p6rt
Copy link
Author

p6rt commented Nov 28, 2008

From @moritz

On Fri Nov 28 01​:09​:44 2008, moritz@​casella.faui2k3.org wrote​:

So infix​:<Z> doesn't seem to like Range objects

I think the idiomatic solution is that both List and Range should do the
`Positional' role, and infix​:<Z> should only rely on the methods from
Positional.

@p6rt
Copy link
Author

p6rt commented Nov 28, 2008

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

@p6rt
Copy link
Author

p6rt commented Nov 28, 2008

From @pmichaud

On Fri Nov 28 02​:26​:42 2008, moritz wrote​:

On Fri Nov 28 01​:09​:44 2008, moritz@​casella.faui2k3.org wrote​:

So infix​:<Z> doesn't seem to like Range objects

I think the idiomatic solution is that both List and Range should do the
`Positional' role, and infix​:<Z> should only rely on the methods from
Positional.

Actually, Ranges don't do 'Positional' -- see S03​:1799.

The correct (and lazy) solution is to not use subscripts at all, and
simply iterate over all of the arguments in parallel to build the result
list, stopping when one of the iterators becomes empty.

Now implemented in r33317. When there's a test for this in spectests,
we can close the ticket.

Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Nov 30, 2008

From @moritz

On Fri Nov 28 10​:55​:51 2008, pmichaud wrote​:

Now implemented in r33317. When there's a test for this in spectests,
we can close the ticket.

Tests added in (pugs) r24122 to S03-operator/range.t. Thanks.

Moritz

@p6rt
Copy link
Author

p6rt commented Nov 30, 2008

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

@p6rt p6rt closed this as completed Nov 30, 2008
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