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

Make iterator zero-copy #4

Closed
nitely opened this issue Nov 7, 2017 · 1 comment
Closed

Make iterator zero-copy #4

nitely opened this issue Nov 7, 2017 · 1 comment

Comments

@nitely
Copy link
Owner

nitely commented Nov 7, 2017

There are a couple of ways this can be implemented:

  • Yield a slice and let the user do text[slice] or iterate over the slice or whatever
  • Yield a View[T] (not yet part of stdlib)
  • Keep yielding strings but also provide a graphemeLenAt, so zero cost abstractions can be created on top of it

graphemeLenAt would be really nice to have regarless. Done, but it's not faster than the iterator.

@nitely
Copy link
Owner Author

nitely commented May 1, 2018

I'll have to wait until OpenArray can be used as a return value. But it seems this won't happen any time soon. In the meantime there is https://github.com/nitely/nim-strunicode

@nitely nitely changed the title Make iterator zero-cost Make iterator zero-copy Sep 11, 2019
@nitely nitely closed this as completed in 68884a4 Feb 17, 2020
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