<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">There have been a number of changes to the ReadWriteStream implementation in Pharo 7 that break Grease stream tests: <a href="https://travis-ci.org/SeasideSt/Grease/jobs/406766720" class="">https://travis-ci.org/SeasideSt/Grease/jobs/406766720</a></div><div class="">I think there is both an issue in Grease for Pharo and in Pharo 7 itself.</div><div class=""><br class=""></div><div class="">* The most important issue is that the following expression returns a different result on Pharo 7 when compared with earlier versions:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span></div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>(ReadWriteStream on: (String new: 4096)) contents</div><div class=""><br class=""></div><div class="">On Pharo 6, this returns an empty string.</div><div class="">On Pharo 7, this returns a string with 4096 white space chars.</div><div class=""><br class=""></div><div class="">I’m inclined to say that Pharo 7 behavior is correct.</div><div class="">I read through the ANSI document and `contents` should return the future sequences as well… which effectively means returning all those empty chars.</div><div class="">I’m a bit in doubt why this has been different all that time… hence my email.</div><div class=""><br class=""></div><div class="">The core of the issue is that GRPharoPlatform>>readWriteCharacterStream is `ReadWriteStream on: (String new: 4096)`, hence a String instance with a lot of spaces ;)</div><div class="">In GRGemStonePlatform, the readWriteStream is initialized on an empty string.</div><div class="">In GRSqueakPlatform, the RWBinaryOrTextStream class is used on ‘ByteArray new: 4096’.</div><div class=""><br class=""></div><div class="">Changing the implementation of GRPharoPlatform>>readWriteCharacterStream to `ReadWriteStream on: String new` fixes most of the tests.</div><div class=""><br class=""></div><div class="">* The next issue is that `ReadWriteStream>>contents` has been changed in <a href="https://github.com/pharo-project/pharo/commit/9e442addff3790af0c78dbc73f1f349de8a4ad03#diff-ba7cc7962a4a22468a18b31fe75ada04" class="">https://github.com/pharo-project/pharo/commit/9e442addff3790af0c78dbc73f1f349de8a4ad03#diff-ba7cc7962a4a22468a18b31fe75ada04</a></div><div class="">This means that:</div><div class=""><div class=""><br class=""></div><div class=""><div class="">| stream |</div><div class="">stream := GRPlatform current readWriteCharacterStream.</div><div class="">stream</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>nextPutAll: 'abc';</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>reset.</div><div class="">self assert: stream contents = 'abc’.</div></div></div><div class=""><br class=""></div><div class="">This is no longer true in Pharo 7.</div><div class="">ANSI docs says that `reset` should only reset the pointer position and thus the future sequences on the stream should still be returned after resetting. </div><div class="">Reverting the change in the commit, also fixes that test.</div><div class="">It’s unclear why that change was made though, so I’ll try to talk to someone at Pharo.</div><div class=""><br class=""></div><div class="">Would be nice to hear other’s thoughts.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Johan</div></body></html>