https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
AFAICT, not really all that close in time:
Python 2.2 (2001)
.NET 1.1 (2003)
PHP (2012-ish, based on RFC date)
JS ES2015 (2015) [though nonstandardized impls in some engines prior]
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csh...
> C# version 2.0 brought iterators. To put it succinctly, iterators let you examine all the items in a List (or other Enumerable types) with a foreach loop. Having iterators as a first-class part of the language dramatically enhanced readability of the language and people's ability to reason about the code.
The implicit assumption in that sentence is that enumerables existed before iterators.
But the non-generic IEnumerable and foreach syntax was in from 1.0 https://docs.microsoft.com/en-us/dotnet/api/system.collectio...
"Yield return" generators is also from 2.0
https://stackoverflow.com/questions/53190388/in-which-versio...
- Enumerator are documented as soon as 1.9.1[1] in 2009[2]
- Enumerable are already present in 1.8.6[3] released in 2006[4], and the matching source code is easily trackable on Github through enumerable.c[5] back to 2005. The Git repository won’t bring any meaningful information before that on this file, due to the import from SVN if I well understand. There is also an enum.c file, but I’m not versed enough in Ruby code base to tell what is it about.
[1] https://ruby-doc.org/core-1.9.1/Enumerator.html
[2] https://www.ruby-lang.org/en/news/2009/01/30/ruby-1-9-1-rele...
[3] https://ruby-doc.org/core-1.8.6/Enumerable.html
[4] https://www.ruby-lang.org/en/news/2007/03/12/ruby-1-8-6-rele...
[5] https://github.com/ruby/ruby/commits/master?after=78425d7e74...
And Generator is present in 1.8 (though I can't determine how early in the 1.8 series). Same basic function, slightly different API (and Generator used Continuations under the hood, while Enumerator uses Fibers, which improved performance and, in theory, implementability in alternative Rubies which didn't all support Continuation, which was one motivation for moving Continuation out of the core language in 1.9.)
After generators were introduced themselves, Generator expressions were added in 2.4, coroutine support with yield as an expression in 2.5, “yield from” to delegate to a subgenerator in 3.3.
So, yeah, that's plausible.