<div dir="ltr">| and &amp; make sure that each expression between them is executed - so it will do each of:<div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">   a date  &gt; b date</span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">and </span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">   a date = b date</span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">and</span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">   a date </span><span style="color:rgb(80,0,80);font-size:12.8000001907349px">&gt; temps &gt; b date temps</span><br></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">This matters if one of these is significantly slower than the others - it will run it even it it doesn&#39;t need too.  Also if any side-effects are in one of these expressions, this will make that side effect happen (there aren&#39;t any in these, though).</span></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px"><br></span></div><div><font color="#500050"><span style="font-size:12.8000001907349px">and: and or: stop executing as soon as one of them is satisfied sufficiently - so if a date &gt; b date then it will immediately return true without bothering with the rest of the expressions.</span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px">ifTrue:ifFalse: is similar - except you will evaluate the condition expression AND one of the following expressions.</span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px">Often this doesn&#39;t matter one way or another - but when it does, it matters a lot.</span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px">-cbc</span></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 4, 2015 at 9:00 AM, Paul DeBruicker <span dir="ltr">&lt;<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does using the | or &amp; notation have any advantages over and: or or:  or<br>
ifTrue:ifFalse ?<br>
<br>
<br>
I always write expressions like the one you&#39;ve written like:<br>
<br>
a date = b date<br>
   ifTrue:[a temps &gt; b temps]<br>
   ifFalse:[a date &gt; b date]<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Louis LaBrunda wrote<br>
<span class="">&gt; Hi Raymond,<br>
&gt;<br>
&gt; Try:<br>
&gt;<br>
&gt; ^notes sorted:[:a :b | (a date  &gt; b date) | ((a date = b date) &amp; (a date<br>
&gt; temps &gt; b date temps))].<br>
&gt;<br>
&gt; Lou<br>
&gt;<br>
</span>&gt; On Wed, 04 Feb 2015 10:34:48 -0500, Raymond Asselin &amp;lt;<br>
<br>
&gt; jgr.asselin@<br>
<br>
&gt; &amp;gt;<br>
<span class="">&gt; wrote:<br>
&gt;<br>
&gt;&gt;I have this kind of sorting on anOrderedCollection<br>
&gt;&gt;<br>
&gt;&gt;BlocNotes &gt;&gt;sortedNotes<br>
&gt;&gt;      ^notes sorted:[:a :b | a date  &gt; b date]<br>
&gt;&gt;<br>
&gt;&gt;This sort my notes on date but I want them sort by date AND inside a date<br>
by hours and I don&#39;t khow how to do this.<br>
&gt;&gt;<br>
&gt;&gt;Some insights?<br>
&gt;&gt;<br>
&gt;&gt;aNote = &#39;med com date temps&#39; instancesVariables what I call hours = temps<br>
witch is a number like 2123 for 21h23<br>
&gt;&gt;<br>
&gt;&gt;Some insights?<br>
&gt; -----------------------------------------------------------<br>
&gt; Louis LaBrunda<br>
&gt; Keystone Software Corp.<br>
&gt; SkypeMe callto://PhotonDemon<br>
&gt; mailto:<br>
<br>
&gt; Lou@<br>
<br>
</span><span class="">&gt;  <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Beginners mailing list<br>
<br>
</span>&gt; Beginners@.squeakfoundation<br>
<br>
&gt; <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/How-to-doubble-sort-a-collection-tp4803657p4803671.html" target="_blank">http://forum.world.st/How-to-doubble-sort-a-collection-tp4803657p4803671.html</a><br>
Sent from the Squeak - Beginners mailing list archive at Nabble.com.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>