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

lev.iterator module #71

Open
hnakamur opened this issue Sep 17, 2012 · 2 comments
Open

lev.iterator module #71

hnakamur opened this issue Sep 17, 2012 · 2 comments
Assignees

Comments

@hnakamur
Copy link
Collaborator

I propose lev.iterator module.
It can be used on tables too because tables are also iterators.

This is draft APIs.

iterator.keys(iter_func):table
iterator.values(iter_func):table

iterator.isEmpty(iter_func):boolean
iterator.count(iter_func):number

iterator.toTable(iter_func):table

iterator.select(iter_func, predicate_func):table

iterator.indexOf(iter_func, predicate_func):number
iterator.lastIndexOf(iter_func, predicate_func):number

iterator.any(iter_func, predicate_func):boolean
iterator.all(iter_func, predicate_func):boolean

@ghost ghost assigned hnakamur Sep 17, 2012
@hnakamur
Copy link
Collaborator Author

I realized these APIs does not depend on lev, so these should be implemented as a separate library.

@kristate
Copy link
Member

I think that this might be valuable to the language, so perhaps we can include it into lev. Instead of an iterator library, perhaps as an extension to tables

@kristate kristate reopened this Sep 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants