On 23 Jul 2018, at 11:13, Ben Coman <btc@openinworld.com> wrote:
On 23 July 2018 at 15:38, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Hello,
I've prepared a draft of a short document that should help you with the transition to the "new" file streams API in Pharo 7.
https://github.com/pavel-krivanek/pharoMaterials/blob/master/Filestreams.MD
Pull requests are welcome.
Cheers, -- Pavel
Some discussion prior to any pull request (and while I'm away from Pharo machine)
I like all the new code examples until "Write a UTF-8 text to STDOUT" and I wonder "Stdio stdout writeStreamDo: [ :stream | stream nextPutAll: 'a â b' ]" would better fit the pattern of the other new code. (presuming "Stdio stdout" returns a FileReference, oherwise maybe "Stdio stdoutRef" or "Stdio stdout asFileReference")
Stdio stdout and friends just return a binary stream, hence they need wrapping for encoding. Maybe Stdio stdoutAsText might be an idea, but this is so uncommon that I am not sure this is a good idea.
Under "Positionable streams", rather than needing "3 timesRepeat: [ stream next ]" would it be worth having #utf8position: to more intention revealing?
no more new API, please. Positioning in a variable length encoded stream is plain hard - see my other mail.
cheers -ben