Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31989

Re: [JLS] new long[0][ -1 ]

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: [JLS] new long[0][ -1 ]
Date Fri, 10 Jul 2015 22:29:17 +0000 (UTC)
Organization A noiseless patient Spider
Lines 23
Message-ID <mnpgvs$h0u$2@dont-email.me> (permalink)
References <slrnmpvci8.uoi.avl@login.logic.tuwien.ac.at> <mnoc71$jah$1@dont-email.me> <slrnmpvgdg.uoi.avl@login.logic.tuwien.ac.at> <mnoi74$8pm$1@dont-email.me> <slrnmpvl62.uoi.avl@login.logic.tuwien.ac.at> <mnp9cb$134$1@dont-email.me> <slrnmq0dm3.uoi.avl@login.logic.tuwien.ac.at>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Fri, 10 Jul 2015 22:29:17 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="17438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NWbbNvSlVDITbb9KQ/94wiXXTp7Wb7MM="
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
Cancel-Lock sha1:4Xp1EKfxv4pXoArhD9Vf5A/fAt8=
Xref csiph.com comp.lang.java.programmer:31989

Show key headers only | View raw


On Fri, 10 Jul 2015 21:17:33 +0000, Andreas Leitgeb wrote:

> Martin Gregorie <martin@address-in-sig.invalid> 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]
> Given that arrays are meant as internal building blocks for higher level
> structures, then the answer would be a custom class that would wrap an
> array and present an interface with custom index ranges.
>
Fair point: I started to realise this as I wrote the previous post. 

Just as an ArrayList does much of what am A68 flexible array does, you 
could subclass an ArrayList with a constructor argument that effectively 
sets the lower bound by being subtracted from, e.g. the get() index to 
make it zero-based.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[JLS] new long[0][ -1 ] Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-10 11:52 +0000
  Re: [JLS] new long[0][ -1 ] Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-07-10 08:02 -0400
    Re: [JLS] new long[0][ -1 ] Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-10 12:58 +0000
      Re: [JLS] new long[0][ -1 ] Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-07-10 09:45 -0400
        Re: [JLS] new long[0][ -1 ] Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-10 14:19 +0000
          Re: [JLS] new long[0][ -1 ] Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-10 20:19 +0000
            Re: [JLS] new long[0][ -1 ] Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-07-10 16:43 -0400
              Re: [JLS] new long[0][ -1 ] Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-10 22:24 +0000
                Re: [JLS] new long[0][ -1 ] Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-07-11 07:33 -0400
            Re: [JLS] new long[0][ -1 ] Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-10 21:17 +0000
              Re: [JLS] new long[0][ -1 ] Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-10 22:29 +0000
            Re: [JLS] new long[0][ -1 ] Arne Vajhøj <arne@vajhoej.dk> - 2015-07-27 22:10 -0400
              Re: [JLS] new long[0][ -1 ] leif.roar@dimnakorr.com - 2015-07-28 01:53 -0500
                Re: [JLS] new long[0][ -1 ] Arne Vajhøj <arne@vajhoej.dk> - 2015-07-28 19:13 -0400
                Re: [JLS] new long[0][ -1 ] leif.roar@dimnakorr.com - 2015-07-28 21:50 -0500
              Re: [JLS] new long[0][ -1 ] Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-28 11:13 +0000
                Re: [JLS] new long[0][ -1 ] Arne Vajhøj <arne@vajhoej.dk> - 2015-07-31 19:41 -0400
                Re: [JLS] new long[0][ -1 ] Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-01 10:23 +0000
  Re: [JLS] new long[0][ -1 ] Joerg Meier <joergmmeier@arcor.de> - 2015-07-10 17:07 +0200
    Re: [JLS] new long[0][ -1 ] Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-07-10 18:10 +0000

csiph-web