Indexing access for Lists and Maps considered harmful?

Artur Biesiadowski abies at adres.pl
Wed Jun 24 10:14:19 PDT 2009


Paul Benedict wrote:
> I am not a fan of this proposal in general. Two things to comment on:
>
> (1) Collections are located in java.util, but the JLS can only
> reference classes in java.lang, correct? If I have my facts correct
> (doubting), this enhancement would set a new precedent by having a
> language feature reach into a non-lang package.
>   
Look at java.lang.Iterable. It was added to implement forach operator 
and by that JLS indirectly references java.util.Iterator.

I think that in each proposal, there are just few new interfaces added 
in java.lang for facilitating [] access. java.util classes will 
implement those classes, but don't have to mentioned in JLS.

So, [] access is not breaking the java.lang boundaries, unlike already 
existing foreach.

Regards,
Artur Biesiadowski



More information about the coin-dev mailing list