Crystal Easy · Lesson 7

Your own collections: Enumerable and Iterator

Include Enumerable(T) and define each to get map, select and sum; implement Iterator(T) with next and stop for lazy, chainable sequences.

Lessons · Crystal Easy · Lesson 7 of 10

Your own collections: Enumerable and Iterator

Include Enumerable(T) and define each to get map, select and sum; implement Iterator(T) with next and stop for lazy, chainable sequences.

Illustration for Crystal
Include Enumerable(T) and define each to get map, select and sum; implement Iterator(T) with next and stop for lazy, chainable sequences.