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

Can't .take uncached Seq #1742

Closed
zoffixznet opened this issue Apr 18, 2018 · 1 comment
Closed

Can't .take uncached Seq #1742

zoffixznet opened this issue Apr 18, 2018 · 1 comment

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Apr 18, 2018

Don't know if it's a limitation or a bug, but if you try to take an uncached Seq it will end up consumed by the time it gets to the other end:

$ perl6 -e 'dd gather { ().Seq.take }'
(Seq.new-consumed(),).Seq

$ perl6 -e 'use nqp; dd gather { THROW(nqp::const::CONTROL_TAKE, ().Seq) }'
(Seq.new-consumed(),).Seq

$ perl6 -v
This is Rakudo version 2018.03-216-g7b5ccaa built on MoarVM version 2018.03-99-g4234ab5
implementing Perl 6.c.

Originally discovered through ... op's use, which does a .take under the hood.

@zoffixznet
Copy link
Contributor Author

Doh. It's the sink that kills it:

$ perl6 -e 'dd gather { $ := ().Seq.take }'
(().Seq,).Seq

Gonna patch up SEQUENCE.

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