Re: [streams] ReadableStream.getReader name is a bit misleading (#308)

I like the current Stream/Reader separation. Sharing a reader might be useful, but it is possible with the current model, and the current model enables us to define streams' behavior precisely. I don't like the idea of leaving behaviors unspecified.

> However, if there were a getReader() method, I would probably have called it Symbol.reader since it is (dubiously) analogous to Symbol.iterator, only in the sense that Iterator implements Symbol.iterator as return this. Down that line of reasoning, read() would be analogous to iterate(), but that collides with the notion that read():Promise<Iteration<Chunk>> is analogous to next():Iteration<Value>.

Such symbol can be useful when we have an async loop syntax, but we can add it later. ES6 set has Symbol.iterator slot but it also has `values()` method. Having both is not a bad thing.


---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/308#issuecomment-89161409

Received on Friday, 3 April 2015 04:45:50 UTC