2 ms·
For Ruby: - 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
by psychoslave 4y ago
For Ruby:
- 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 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-released/ 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 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-released/ https://www.ruby-lang.org/en/news/2007/03/12/ruby-1-8-6-rele...
[5] https://github.com/ruby/ruby/commits/master?after=78425d7e74887b57ee15e6b8933bd3878db6a888+314&branch=master&path%5B%5D=enumerator.c&qualified_name=refs%2Fheads%2Fmaster https://github.com/ruby/ruby/commits/master?after=78425d7e74...
- dragonwriter 4y ago> Enumerator are documented as soon as 1.9.1[1] in 2009[2] 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.)