Re: 7.0 wishlist?

Hash: SHA1

Harold Yarmouth schreef:
Hendrik Maryns wrote:
Harold Yarmouth schreef:
Hendrik Maryns wrote:
[some attributions are missing here, but I think it's just me and
Hendrik alternating]

I am sorry for that.

It does, but let me think about this a bit:

{ 1, 3 } is an array, so should, like any array in Java, be passed by

Now, is it mutable? Take the method

public void nasty(int[] ints) {
ints[0] = 0;
// other stuff

What do you propose would happen if you did nasty({ 1, 3 })? Without
the comment, nothing of course, but let’s just assume the ‘other stuff’
does more with the array, like use its values.

What does it currently do if passed

static final int[] array = {1, 3};

If that array can actually be modified, then there's a bit of ugliness
in Java, but it does not stem from any proposal of mine.

I think it is modifiable. AFAIK, there is no way in (current) Java to
make an array immutable.

I tend to agree that this is a bit of ugliness.

So I’d say: even you literal is mutable. I don’t think it is desirable
to introduce new behavior here.

But are we? See above.

Which above? If you mean the array should be immutable, then AFAIK you
are introducing new behavior, since there is no way to do that now.

- --
Hendrik Maryns
Ask smart questions, get good answers:
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE -


Relevant Pages

  • Re: find a number
    ... You need GnuPG to verify this message ... Don Roby schreef: ... //copying array a to array b ...
  • Re: find a number
    ... You need GnuPG to verify this message ... and every element in the array ... it indeed accesses one slot twice. ...
  • Re: A crosspost from the Perl Community
    ... Do you remember that numbers is an array of integers 10 LOC later? ... The issue you describe is not an issue of a broken tool or feature. ... Comment: Using GnuPG with Mozilla - ...
  • rs in debian
    ... specified transformation to the array, and writes it out with the ... Comment: Using GnuPG with Mozilla - ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
  • Re: output of a method to file?
    ... Then, I create a counter to help me later on, as well as an empty array. ... in the case that I can divide the index by 3 ... This uses Ruby's String interpolation to create, for example, "Boston ". ... Comment: Using GnuPG with Mozilla - ...