github/ReactiveCocoa — pull request #271 by Coneko (2013-01-08 01:00:05+00:00)
Title: Add -[NSEnumerator rac_signal].

Because of #238, I can't use very long lazy sequences, and while eager sequences do work, it feels like I'm missing the point with them.

With this I can iterate and transform over enumerators with a fixed memory footprint, interrupt the iteration whenever I want without having wasted time transforming values I wasn't going to use, and the values can be evaluated lazily.

For context, I'm working with `enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:`. Directories with several thousand descendants aren't uncommon.

Note that even if #238 wasn't an issue, lazy sequences still wouldn't have a fixed memory footprint on iteration, because their semantics require them to memoize their values. Enumerators' semantics allow them to discard values as soon as they're returned. Because of that the enumerator -> signal direct transformation does maintain certain properties that the enumerator -> sequence -> signal indirect transformation loses.

I think that makes these methods useful in a general case.