<br><br><div class="gmail_quote">2009/11/27 Diego Gomez Deck <span dir="ltr">&lt;<a href="mailto:DiegoGomezDeck@consultar.com">DiegoGomezDeck@consultar.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
&gt; Nicolas&gt; The path to a cleaner/faster stream library is longer than just this<br>
&gt; Nicolas&gt; little step.  Beside testing, we&#39;d have to refactor the hierarchy,<br>
&gt; Nicolas&gt; insulate all instance variables, and delegate as much as possible as<br>
&gt; Nicolas&gt; Igor suggested.  We&#39;d better continue on the cleaning path and not<br>
&gt; Nicolas&gt; just add another FileStream subclass complexifying a bit more an<br>
&gt; Nicolas&gt; unecessarily complex library.<br>
&gt;<br>
&gt; Michael Lucas-Smith gave a nice talk on Xtreams at the Portland Linux Users<br>
&gt; Group.  The most interesting thing out of this is the notion that #atEnd is<br>
&gt; just plain wrong.  For some streams, computing #atEnd is impossible.  For most<br>
&gt; streams, it&#39;s just expensive.  Instead, Xtreams takes the approach that #do:<br>
&gt; suffices for most people, and for those that can&#39;t, an exception when you read<br>
&gt; past end-of-stream can provide the proper exit from your loop.  Then, your<br>
&gt; loop can concentrate on what happens most of the time, instead of what happens<br>
&gt; rarely.<br>
<br>
I think we need a common superclass for Streams and Collection named<br>
Iterable where #do: is abstract and #select:, #collect:, #reject:,<br>
#count:, #detect:, etc (and quiet a lot of the messages in enumerating<br>
category of Collection) are implemented based on #do:<br></blockquote><div><br></div><div>Maybe I&#39;m wrong but I think traits are a good (better) solution for that kind of problem. #do can be a required method and you can implement remaining methods with #do </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Of course Stream can refine the #select:/#reject methods to answer a<br>
FilteredStream that decorates the receiver and apply the filtering on<br>
the fly.  In the same way #collect: can return a TransformedStream that<br>
decorates the receiver, etc.<br>
<br>
Just my 2 cents.<br>
<br>
Cheers,<br>
<font color="#888888"><br>
-- Diego<br>
<br>
<br>
<br>
</font></blockquote></div><br>