<div dir="ltr">| and & 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 > 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">> temps > 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't need too. Also if any side-effects are in one of these expressions, this will make that side effect happen (there aren'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 > 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'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"><<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>></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 & notation have any advantages over and: or or: or<br>
ifTrue:ifFalse ?<br>
<br>
<br>
I always write expressions like the one you've written like:<br>
<br>
a date = b date<br>
ifTrue:[a temps > b temps]<br>
ifFalse:[a date > b date]<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Louis LaBrunda wrote<br>
<span class="">> Hi Raymond,<br>
><br>
> Try:<br>
><br>
> ^notes sorted:[:a :b | (a date > b date) | ((a date = b date) & (a date<br>
> temps > b date temps))].<br>
><br>
> Lou<br>
><br>
</span>> On Wed, 04 Feb 2015 10:34:48 -0500, Raymond Asselin &lt;<br>
<br>
> jgr.asselin@<br>
<br>
> &gt;<br>
<span class="">> wrote:<br>
><br>
>>I have this kind of sorting on anOrderedCollection<br>
>><br>
>>BlocNotes >>sortedNotes<br>
>> ^notes sorted:[:a :b | a date > b date]<br>
>><br>
>>This sort my notes on date but I want them sort by date AND inside a date<br>
by hours and I don't khow how to do this.<br>
>><br>
>>Some insights?<br>
>><br>
>>aNote = 'med com date temps' instancesVariables what I call hours = temps<br>
witch is a number like 2123 for 21h23<br>
>><br>
>>Some insights?<br>
> -----------------------------------------------------------<br>
> Louis LaBrunda<br>
> Keystone Software Corp.<br>
> SkypeMe callto://PhotonDemon<br>
> mailto:<br>
<br>
> Lou@<br>
<br>
</span><span class="">> <a href="http://www.Keystone-Software.com" target="_blank">http://www.Keystone-Software.com</a><br>
><br>
> _______________________________________________<br>
> Beginners mailing list<br>
<br>
</span>> Beginners@.squeakfoundation<br>
<br>
> <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>