24
bojo
7y

Yup, that's about right.

Comments
  • 13
    Java 9 is out, so why can't you at least be on Java 8 common library by now?

    int[] evens = new int[50], post5 = new int[45];
    Arrays.setAll(evens, i -> i*2);
    System.arraycopy(evens, 5, post5, 0, 45);

    Obviously there's libraries (even in Java7) that let you do array ranges.
  • 2
  • 0
    Whereas Java is eager and Haskell is lazy, so technically, verbose but calculated on site.
  • 0
    @xsacha I'm not a Java dev, so none of this is obvious to me.
  • 0
    My big worry is that it won't be constexpr. I wouldn't want to spend cycles calculating something known AOT.
Add Comment