IIUC that means that a stream implementation compatible with the standard streams cannot be implemented on top of the new streams, right? What is the plan about #upToAll:, #match: and similar messages which are very useful for parsing? Where should they go? Bernhard
Am 31.12.2017 um 17:07 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
On 31 Dec 2017, at 16:21, Bernhard Pieber <bernhard@pieber.com> wrote:
Hi Sven,
Thanks for the answer. This is exactly what I was looking for. And it is great that there is also documentation.
However, ZnCharacterReadStream does not implement #upToAll:. The implementation from PositionableStream cannot easily be borrowed because there seems to be no way to reset the position. Is there a plan to support the most commonly used messages from the normal streams?
The Stream API is much too wide, it has to be reduced and split in a number of elementary streams that can be composed to add desired behaviour (like character encoding/decoding, buffering, line end translation, ...). Positioning in a stream (moving backwards without restrictions) is not generally possible (think of a network stream), that is why it is not implemented.
Bernhard
Am 30.12.2017 um 18:03 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfu...
1.4. Converting Streams
On 30 Dec 2017, at 13:27, Bernhard Pieber <bernhard@pieber.com> wrote:
I just saw that the FileStream hierarchy including MultiByteFileStream is deprecated. However, I can't find what file stream class should be used to read a UTF-8 encoded file instead. FileReference>>#readStreamDo: also uses MultiByteFileStream.
Can someone please point me to the right code?
Bernhard