<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-28 21:46 GMT+02:00 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hi Nicolas,</div><div><br></div><div>    Why can&#39;t you use peekLast?  Seems to me ensureEndsWith: should be implemented in terms of peekLast.<br>
<br>Aloha,<br>Eliot (phone)</div><div><div class="h5"><div><br>On Jul 28, 2014, at 5:05 AM, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
<br></div></div></div></div></blockquote><div><br></div><div>Yes, peekLast sounds perfect. Case of blindness?<br>Oh, I was looking in PositionnableStream which has peekBack... That might explain.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div><div class="h5"><div></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-28 17:02 GMT+02:00 Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi, I need to retrieve the last object put on a Stream (well SmartRefStream does).<br>

</div>This is very much like #ensureEndsWith:<br><br></div>There is back, but back leave the stream positionned before the last object.<br>
<br>((ReadWriteStream on: String new) nextPutAll: &#39;abc&#39;; back) -&gt; $c<br>((ReadWriteStream on: String new) nextPutAll: &#39;abc&#39;; back; position) -&gt; 2.<br><br></div>There is peekBack, but peekBack answers the last but one...</div>


<div><br></div>((ReadWriteStream on: String new) nextPutAll: &#39;abc&#39;; peekBack) -&gt; $b.<br>((ReadWriteStream on: String new) nextPutAll: &#39;abc&#39;; peekBack; position) -&gt; 3.<br><br><div>Note that neither back nor peekBack is understood by a WriteStream.<br>


</div>It requires a ReadWriteStream.<br><br></div>Since peekBack is the sole sender of oldBack in trunk, I wonder who is using it?<br></div>I ask because I&#39;d like to change the meaning of peekBack to that of back instead of oldBack.<br>


</div>Unless you have a better selector to propose?<br><div><div><div><br></div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">More exactly, I&#39;d like to implement PositionnableStream&gt;&gt;peekBackFor: anObject to return a Boolean like peekFor: and it would be a good thing that peekBack answers the same Object.<br>

</div></div>
</div></blockquote><blockquote type="cite"><div><span></span><br></div></blockquote></div></div></div><br><br>
<br></blockquote></div><br></div></div>