[COTDC] 89 - NullStream

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[COTDC] 89 - NullStream

Sean P. DeNigris
Administrator
Continuing in Collections...

Today:  NullStream


Comment Of The Day Contest - One Day One Comment
Rules:
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest

p.s. this message was sent from a pharo image. Did you know you could easily do that?!

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 89 - NullStream

Stéphane Ducasse
I'm a stream doing nothing (NullObject pattern). I can be handy when a stream is needed and that we need to do nothing (for example
a logging in off mode).

Stef
On Dec 3, 2011, at 11:29 AM, [hidden email] wrote:

> Continuing in Collections...
>
> Today:  NullStream
>
>
> Comment Of The Day Contest - One Day One Comment
> Rules:
> #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
> #2: If you cannot comment it, deprecate it.
> Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
>
> p.s. this message was sent from a pharo image. Did you know you could easily do that?!
>


Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 89 - NullStream

Igor Stasenko
On 3 December 2011 23:27, Stéphane Ducasse <[hidden email]> wrote:
> I'm a stream doing nothing (NullObject pattern). I can be handy when a stream is needed and that we need to do nothing (for example
> a logging in off mode).
>

is it for write only or for read as well (always answering nil and
always 'at end')?

> Stef
> On Dec 3, 2011, at 11:29 AM, [hidden email] wrote:
>
>> Continuing in Collections...
>>
>> Today:  NullStream
>>
>>
>> Comment Of The Day Contest - One Day One Comment
>> Rules:
>> #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
>> #2: If you cannot comment it, deprecate it.
>> Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest
>>
>> p.s. this message was sent from a pharo image. Did you know you could easily do that?!
>>
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 89 - NullStream

Sean P. DeNigris
Administrator
Igor Stasenko wrote
is it for write only or for read as well (always answering nil and
always 'at end')?
For reading, it is a never-ending stream (#atEnd always answers false) of zeros (in binary mode) or null characters.

Thanks Steph for the comment!
Cheers,
Sean