<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 16 Jun 2016, at 7:08 AM, 'Jecel Assumpcao Jr.' <a href="mailto:jecel@merlintec.com" class="">jecel@merlintec.com</a> [self-interest] <<a href="mailto:self-interest@yahoogroups.com" class="">self-interest@yahoogroups.com</a>> wrote:</div><div class=""><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: relative;" class=""><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;" class=""><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;" class=""><p style="line-height: 1.22em; margin: 0px 0px 1em;" class="">you might find the stream framework that Craig Latta created for<br style="line-height: 1.22em;" class="">Smalltalk (also called "Flow" - great minds think alike)</p></div></div></div></div></blockquote>Ha. Probably only so many watery metaphors out there :) I’ll have a look</div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: relative;" class=""><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;" class=""><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;" class=""><p style="line-height: 1.22em; margin: 0px 0px 1em;" class="">In the book "Little Smalltalk", Tim Budd mentions that his generators<br style="line-height: 1.22em;" class="">were composable unlike Smalltalk-80's streams<br style="line-height: 1.22em;" class=""><br style="line-height: 1.22em;" class="">><span class="Apple-converted-space"> </span><a href="http://sdmeta.gforge.inria.fr/FreeBooks/LittleSmalltalk/ALittleSmalltalk.pdf" style="line-height: 1.22em; font-family: Verdana;" class="">http://sdmeta.gforge.inria.fr/FreeBooks/LittleSmalltalk/ALittleSmalltalk.pdf</a><br style="line-height: 1.22em;" class=""><br style="line-height: 1.22em;" class="">Chapter 8 explains that generators use the protocol #first and #next.<br style="line-height: 1.22em;" class="">Streams use #next and #atEnd instead, but they can have nil as an<br style="line-height: 1.22em;" class="">element while generators can’t.<br style="line-height: 1.22em;" class=""></p></div></div></div></div></blockquote><div>interesting. What to do with the end of streams seems a common point of variance.</div><div><br class=""></div><div>Smalltalk-80 uses ‘atEnd’, which doesn’t work if the only way you can find out if you are at the end is to read and fail (such as a socket).</div><div><br class=""></div><div>The newer system Xtreams[1] as far as I can tell uses exceptions which Self doesn’t have.</div><div><br class=""></div><div>From what you say Little Smalltalk uses nil, which means you can’t put nil in your streams.</div><div><br class=""></div><div>I considered a specific EndOfStream object, and in the end chose to go with the common Self pattern of passing in error handlers, i.e. </div><div><br class=""></div><div><i class="">stream readIfFail: [|:e| do something with e]   and</i></div><div><i class="">stream write: obj IfFail: [|:e| what went wrong? ]</i></div><div><br class=""></div><div>The other main differences with my flow I think is the plugging together of streams and filters is done more explicitly. e.g. compare this in xtreams:</div><div><br class=""></div><div><i class="">String new writing<br class="">write: 5 from: ’Hello World’ reading; conclusion.</i></div><div><br class=""></div><div>with the flow equivalent:</div><div><br class=""></div><div><i class="">((‘Hello World’ reading |= ‘' writing) pulIUpTo: 5) contents</i></div><div><br class=""></div><div>First you build your pipeline, then you make it do work, then you convert your result into something non-stream. </div><div><br class=""></div><div>Of course it would be even nicer if we had a proper cascade operator like Tim Budd put in Little Smalltalk (which was an improvement over Smalltalk-80’s use of $;), then we could say:</div><div><br class=""></div><div><div><i class="">'Hello World’ reading |= ‘’ writing; pulIUpTo: 5; contents</i></div><div class=""><br class=""></div><div class="">Oh well, add it to the Yak shaving list.</div></div><div><br class=""></div><div>Russell </div><div><br class=""></div><div><br class=""></div>[1]: <a href="http://www.esug.org/wiki/pier/Conferences/2010/Talks/Xtreams" class="">http://www.esug.org/wiki/pier/Conferences/2010/Talks/Xtreams</a></div><div>This starts off looking really nice then seems to become quite complex!</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: relative;" class=""><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;" class=""><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;" class=""><p style="line-height: 1.22em; margin: 0px 0px 1em;" class=""><br style="line-height: 1.22em;" class="">-- Jecel<br style="line-height: 1.22em;" class=""></p></div><div style="line-height: 1.22em; color: rgb(255, 255, 255); height: 0px;" class=""></div></div></blockquote></div><br class=""></body></html>