Add each_line enumerator to IO class#10
Conversation
fbe0b4e to
59eb99b
Compare
|
In the Ruby IO object, each_line takes the line separator and limit as arguments. Would that be possible to include here? |
|
I ran into trouble with this, and the only way around it seems to be to use the My goal here is to be able to take a lazy enumerator (like you'd use for an infinite sequence) and use it to create an infinitely long IO stream. In other words, to drive a stream of bytes from a generator function. The problem I'm running into here is that either I implement it as a lazy enumerator (which causes But yes, if I can find away around that, I'd add those other methods. Do you have any ideas for how to accomplish this? The last thing I tried was to create a child class of |
|
I found a solution to this while developing an unrelated project: use |
a51c4ae to
1be2c16
Compare
1be2c16 to
466417e
Compare
I worked around your suggestion by yielding a literal core |
This enables the following: