Hi Denis, On 11 April 2018 at 17:16, Denis Kudriashov <[email protected]> wrote: > > 2018-04-11 17:02 GMT+02:00 Sven Van Caekenberghe <[email protected]>: >> >> >> >> > On 11 Apr 2018, at 16:36, Sven Van Caekenberghe <[email protected]> wrote: >> > >> > I can make your example, using the Zn variants, work with the following >> > change: >> > >> > StdioStream>>#atEnd >> > ^ peekBuffer isNil or: [ (peekBuffer := self next) isNil ] >> >> Argh, make that >> >> atEnd >> ^ peekBuffer isNil and: [ (peekBuffer := self next) isNil ] > > > But discussion exactly about "self next isNil": how to avoid it.
Apologies in advance for being pedantic, but... Do you really mean this (that the discussion is about how to avoid testing "self next isNil")? My argument has been that without making #atEnd blocking it is not possible to avoid the test (and we don't want to make #atEnd blocking). All the existing stream code that deals with character / byte streams does this test (see my "unwritten rules" from a previous reply). We don't want to make #atEnd blocking, so we need to keep the test (and my personal opinion is that changing the Zinc streams to adopt this approach does not add any significant architectural complexity). Assuming we reach agreement on the above, we do need to make the "unwritten rules" written. If we reach a different agreement we should document that. Cheers, Alistair
