Ruby has a general iterator superclass (mixin really) in its core, called Enumerable. It contains methods such as map, grep, sort etc. The only method required from the including class is each which iterates over all elements, calling the block for every element (though the Array class overrides some methods for efficency). There are also some libraries providing extra methods to this class.
In reply to Re: A standard Iterator super class?
by ambrus
in thread A standard Iterator super class?
by jfroebe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |