Nope, if you want version 7 of List, you can't even use version 9 of
List, because version 9 of List declares 'filter', which you can't
work with. The module system does not,as far as I can tell, allow you
to make the distinction: "I'm just using these" and "I'm extending
list, and therefore you can't give me version 9, or there's a runtime
error when I don't have my filter method".
Your rant on closures being seen as the key to the life of java: Who
here in this thread has claimed that java is going to die without
closures, and is going to be the best of the best with them? You're
arguing against a straw man.
Still, you've given me an idea. If java never gets closures, then java
really is dead*. Not because closures are a panacea, but, for an
entirely different reason: The majority of the community wants them.
If java never delivers something that everyone wants, it's dead.
Simple. Doesn't matter what the feature being asked for is. As long as
the feature is reasonably well defined and there's a way to get there
without too much collateral damage, java should get there if the
community has made up its mind. It's okay if this takes careful
deliberation and years of design considerations, but if it does happen
within a reasonable time-span after community consensus, java is
dead**.
*) Assumptions:
1. The community is convinced closures are a good idea (which at java
events seems to be sort of true, but that's not the ENTIRE community,
just the most active members, though their say certainly should count
more. The internet is a meritocracy, not a democracy, because the
meritocracy model is more efficient, the internet is ruthless
competition, and going against this grain will eventually get you
killed.
2. At some point the community starts focusing on a single closure
proposal, which might simply mean that the focus shifts a little from
'What's the best closure proposal' to 'which one(s) are good enough
for you?'
If those assumptions don't pan out, then java not getting closures is
no cause to say java is dead.
**) 'dead' in the sense that cobol is dead. Due to java's legacy,
we'll have java code running critical systems and a few old farts
earning a pretty penny keeping them running for a very long time
indeed, but we all have our gut instincts regarding languages like
cobol, ada, pl/1, fortan, etcetera. When I say those languages are
'dead', I mean: They don't get taught at universities and you'd be
laughed out of the room for suggesting it there, no one is offering
courses, and nobody is lining up to learn them autodidactically
either. No new projects are being written in them, and deployments are
ever going down, never going up.
NB: Viktor - a key difference between many of the extension point
proposals is where you are allowed to declare the extension. In many
proposals, you use a variant of static import (something like: import
static Collections.sort into List), but now we either need to
configure our IDEs to add a busload of static import statements on
every source file, which can't be the right answer, or we need a 'read
this file, and import everything IT imports' kind of system, or we
need a module-level import system. Other proposals allow the target
type to declare its own extensions, which doesn't allow you to 'hack'
existing code, but it does allow existing code, particularly
interfaces, to add new stuff without breaking backwards compatibility,
and to add functionality on interfaces which doesn't usually change
between implementations thereof, such as most of the stuff in
java.util.Collections and java.util.Arrays. There are advantages and
disadvantages to each, and you could even combine the proposals quite
easily.