Re: Generics
Jan Thom4 wrote:
Mark Space wrote:
I think some new types in the collection interface (RefiableHashMap,
RefiableTreeSet, etc.) and a modification to the generic syntax for
reifiable types would allow backwards compatibility with the old types
while giving folks the option to move to reifiable types.
Well they did that in Dot.Net which introduced a lot of headaches because
you could no longer use libraries that used untyped collections together
with typed collections. So if you wanted to use a library that was still
This is a good point. Lately I've been advocating some sort of
annotation that would give the compiler a hint for it to generate
boilerplate.
Try to do that on one's own runs into two problems:
1. Not everyone is going to implement their own API in the same way. So
non-standard and diverse implementations make it harder on the programmer.
2. The Class class is final, and can't be extended for a new class type
or new methods. If Sun would add a new type, or a some new methods to
Class, to support a type with reifiable types, again folks would not
have to come up with their own non-standard solutions.
I think just adding boilerplate to the existing classes would keep
backwards compatibility. The Class issue might be harder, but if the
new class type is only available through new interfaces, then I think
computability issues will be kept to a minimum.