Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-22 Thread Sven Van Caekenberghe
https://github.com/pharo-project/pharo/pull/2695 > On 18 Feb 2019, at 16:52, Sven Van Caekenberghe wrote: > > OK, I that is what I expected. > I will study this again and make a PR with better comments and tests. > >> On 18 Feb 2019, at 16:32, ducasse wrote: >> >>> >>> >>> I have been thin

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-18 Thread Sven Van Caekenberghe
OK, I that is what I expected. I will study this again and make a PR with better comments and tests. > On 18 Feb 2019, at 16:32, ducasse wrote: > >> >> >> I have been thinking a bit more about this, and I have a lot of problems with >> >> Integer>>#putOn: aStream >> aStream isBinary >>

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-18 Thread ducasse
> > I have been thinking a bit more about this, and I have a lot of problems with > > Integer>>#putOn: aStream > aStream isBinary > ifTrue: [ self asByteArray do: [ :each | aStream nextPut: each > ] ] > ifFalse: [ self asString putOn: aStream ] > > I think we

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-18 Thread ducasse
Hi sven what I do not really with asString is that it potentially created another stream. with << the implementation of camillo (if I remember correctly) manages correctly both single object and collection and it is nice to have. I do not know if his implementation does not create additional s

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-16 Thread Alistair Grant
On Sat, 16 Feb 2019 at 15:49, Sven Van Caekenberghe wrote: > > > On 16 Feb 2019, at 14:35, Alistair Grant wrote: > > > > Hi Sven & Jan, > > > > On Fri, 15 Feb 2019 at 10:25, Sven Van Caekenberghe wrote: > >> > >> Hi Jan, > >> > >> I like #<< too, but I think your assumption that it can print any

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-16 Thread Sven Van Caekenberghe
> On 16 Feb 2019, at 14:35, Alistair Grant wrote: > > Hi Sven & Jan, > > On Fri, 15 Feb 2019 at 10:25, Sven Van Caekenberghe wrote: >> >> Hi Jan, >> >> I like #<< too, but I think your assumption that it can print anything on a >> stream is generally wrong, dangerous and unreliable. >> >

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-16 Thread Alistair Grant
Hi Sven & Jan, On Fri, 15 Feb 2019 at 10:25, Sven Van Caekenberghe wrote: > > Hi Jan, > > I like #<< too, but I think your assumption that it can print anything on a > stream is generally wrong, dangerous and unreliable. > > IMHO, you better stick to #print: in that case. > > Consider the follow

Re: [Pharo-users] Streams for FileReference in Pharo 7

2019-02-15 Thread Sven Van Caekenberghe
Hi Jan, I like #<< too, but I think your assumption that it can print anything on a stream is generally wrong, dangerous and unreliable. IMHO, you better stick to #print: in that case. Consider the follow, that all fail: String streamContents: [ :s | s << 'hello' << 42.5 << $! ]. String strea

[Pharo-users] Streams for FileReference in Pharo 7

2019-02-15 Thread Jan Blizničenko
Hello everyone I am trying to use Pharo 7 for my project and I noticed that most of my streams related code does not work anymore. Reason is that API for streams received from writeStream of FileReference changed and I think it changed for the worse in my case, because << does not properly handle