<div dir="ltr"><div><div><div><div>The use of a NullDate is not incompatible with something wanting to sort Events in a particular way. If we think about how NullDate's should be sorted we can see a very limited number of possibilities<br><br></div>- place at the end<br></div>- place at the beggining<br><br></div>So our NullDate could support a convention when implementing comparable to make one of these choices and perhaps allow configuration to choose the other. This would allow Events (and lots of other stuff) to use NullDates, and allow Event collections to control how Date's effect the ordering. <br><br></div>I wonder should this functionality actually be in Date?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 July 2015 at 11:51, James Mead <span dir="ltr"><<a href="mailto:james@floehopper.org" target="_blank">james@floehopper.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I just came across the undocumented Date::Infinity class [1] which<br>
might be of some relevance to this thread.<br>
<br>
[1]: <a href="https://github.com/ruby/ruby/blob/c8b3f1b470e343e7408ab5883f046b1056d94ccc/ext/date/lib/date.rb#L7..L58" rel="noreferrer" target="_blank">https://github.com/ruby/ruby/blob/c8b3f1b470e343e7408ab5883f046b1056d94ccc/ext/date/lib/date.rb#L7..L58</a><br>
<div class="HOEnZb"><div class="h5"><br>
On 17 July 2015 at 00:53, Paul Makepeace <<a href="mailto:paulm@paulm.com">paulm@paulm.com</a>> wrote:<br>
> On Thu, Jul 16, 2015 at 3:24 PM, Stephen Best <<a href="mailto:bestie@gmail.com">bestie@gmail.com</a>> wrote:<br>
>><br>
>> events.sort_by { |e|<br>
>>   e.date { heat_death_of_the_universe }<br>
>> }<br>
>><br>
><br>
> This to me is the clearest of the proposals (Tom's role idea is cool too).<br>
><br>
> For a null object you could also use... nil<br>
><br>
>   events.sort_by { |e|<br>
>     e.date || date_that_sorts_at_the_end  # (named to be clearer about intent)<br>
>   }<br>
><br>
> The whole discussion has been really interesting!<br>
><br>
> Paul<br>
> _______________________________________________<br>
> Chat mailing list<br>
> <a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
> Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
> Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
> List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div>------------------------</div>Andrew Premdas<div><a href="http://blog.andrew.premdas.org" target="_blank">blog.andrew.premdas.org</a></div></div>
</div>