Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: [JLS] new long[0][ -1 ] Date: Mon, 27 Jul 2015 22:10:41 -0400 Organization: Aioe.org NNTP Server Lines: 26 Message-ID: References: NNTP-Posting-Host: bLmKSxgyEsD8qtT7wjgUDQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Mozilla-News-Host: news://nntp.aioe.org Xref: csiph.com comp.lang.java.programmer:32169 On 7/10/2015 4:19 PM, Martin Gregorie wrote: > Two features I'd have liked to see in Java are non-zero based arrays, e.g. > int temperatureOcurrences[-40:55] and flexible array bounds, e.g > int samples[0:flex] > > Neither are new ideas, both dating from the '60s: Algol 60 had non-zero- > based fixed size arrays and Algol 68 implemented both concepts: both are > useful in some circumstances as is multi-dimensional array slicing (Algol > 68 had that too). I agree that non-zero based arrays can result in much cleaner code in some cases. But I think it has to be bundled with another feature: the use of other types than int as array indexes. I don't think that it is desirable or likely to shoehorn into Java at this time. If one want it then I suggest Ada and JGnat! :-) Arne