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

Shouldn't iterator be called something else – e.g. operation? #1011

Closed
behrangsa opened this issue Jan 24, 2016 · 9 comments
Closed

Shouldn't iterator be called something else – e.g. operation? #1011

behrangsa opened this issue Jan 24, 2016 · 9 comments
Labels

Comments

@behrangsa
Copy link

In:

each(arr, iterator, [callback])

The second argument is not the iterator. each itself is the iterator. The second argument is an operation that the iterator perform on each and every member of the passed array, arr.

Am I missing something here?

@aearly aearly added the docs label Feb 2, 2016
@aearly
Copy link
Collaborator

aearly commented Feb 2, 2016

Our nomenclature is a bit weird. All these examples predate the official iterator spec. It's hard to pick a better word --- taskFn, operation, asyncFn, iteratingFn, etc...

To make things more confusing, we're going to add support for ES6 iterators in addition to plain arrays for functions like each. And then there's the async function () {} syntax on the horizon...

@megawac
Copy link
Collaborator

megawac commented Feb 3, 2016

iteratee is the technically correct term

@aearly
Copy link
Collaborator

aearly commented Feb 3, 2016

The benefits of having a contributor who still remembers his CS! Should we change the docs across the board to use iteratee?

@behrangsa
Copy link
Author

I would say yes, let's use iteratee.

@crispen-smith
Copy link
Contributor

For what its worth +1, Aldo please let me know if I can help with this change.

@megawac
Copy link
Collaborator

megawac commented Feb 3, 2016

@crispen-smith make the pull request if interested otherwise me or Alex will whenever we have some spare time

@crispen-smith
Copy link
Contributor

I'll submit in the next few days.

@crispen-smith
Copy link
Contributor

PR Submitted.

@aearly
Copy link
Collaborator

aearly commented Feb 9, 2016

Closed via #1021

@aearly aearly closed this as completed Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants