<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 May 2013 11:21, Florian Weimer <span dir="ltr">&lt;<a href="mailto:fweimer@redhat.com" target="_blank">fweimer@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 04/18/2013 01:08 AM, Björn Persson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Florian Weimer wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, Ada has some nice features.  At least there are real arrays, but<br>
they are somewhat cumbersome to work with, compared to Java, Python or,<br>
well, C pointers.  There are two aspects: preservation of array bounds<br>
in slices (so that you have to write Table (Table&#39;First + Offset) to<br>
access the element Offset of Table, Offset ranging from 0 to<br>
Table&#39;Length - 1)<br>
</blockquote>
<br>
That array bounds must be preserved becomes obvious when you consider<br>
arrays where the index type has a meaning beyond just position in the<br>
array. If you have an array Week with a range of Monday..Sunday, and<br>
you take the slice Week(Saturday..Sunday) and call it Weekend, then you<br>
really don&#39;t want Weekend to suddenly have the indexes Monday and<br>
Tuesday.<br>
</blockquote>
<br></div>
Weekdays are a very bad example because it is locale-dependent whether Monday &lt; Sunday or the other way round.  So you really can&#39;t fit them well into an enumeration type, and Java 8 orders the enumeration values alphabetically by their name, to make that point perfectly clear.<br>

<br></blockquote><div><br></div><div>I suppose a week actually looks like a ring buffer rather than a linear array.  Week(Saturday..Sunday) would make sense in that context, but it&#39;d take someone more familiar with esoteric languages than me to say whether there&#39;s any language that provides that (not a feature much in demand I&#39;d think).<br>
</div></div><br>-- <br>imalone<br><a href="http://ibmalone.blogspot.co.uk" target="_blank">http://ibmalone.blogspot.co.uk</a>
</div></div>