> > 1) Optional definition site variance.  When I want co or contra-
> > variant type parameters now I have to litter my code with Foo<?
> > extends Bar> or Foo<? super Bar>.  It's so painful I mostly don't
> > bother making my types as general as they could be.
>
> How would this work? I don't think the scala strategy (cartoon
> swearing instead of 'extends' and 'super' keywords) is viable.

Reinier,

I think it's a great idea, you just have to use it in the right spots.
If I recall correctly the example on scala-lang.org was an immutable
list -- obviously a list of Strings is also an immutable list of
Objects;

ImmutableList<? extends Object> list = new ImmutableList<String>();

is very verbose and casting is plain dirty.

PS: It was an immutable stack: http://www.scala-lang.org/node/129

With kind regards
Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to