river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Grahn <grahn...@gmail.com>
Subject Re: correctness, generics, and spaces
Date Thu, 02 Jun 2011 04:38:42 GMT
On Wed, Jun 1, 2011 at 11:33 PM, Peter Firmstone <jini@zeus.net.au> wrote:
> Remember the compiler doesn't type check dynamic code conversion, only
> static conversion.  Dynamic happens at runtime.  Services are dynamic,
> discovered at runtime.

As I said, I believe that with one additional proviso (which can be
enforced at runtime), all dynamic casts will be correct.   To recap,
that proviso is abolishing unassigned type variables from Entry

Could be mistaken.   Would be interested in a counter-example.

The proposal is to use method-level generics, as follows:
<T extends Entry> T read (T template)

The primary effect of this change is upholding the stated contract of
read/take, while reducing boilerplate.

When we had our first discussion of generics, a corner case was
pointed out that was problematic with or without generics.   Some felt
it was worse with generics.   The corner case can be removed, as I

If the casts are always correct (counter-example welcome), there might
still be something objectionable about this change... but I'd
appreciate some clarification as to what that objection is.   I don't
believe that any annotations or fancier tools will be necessary.

I hope to submit a patch for the generics branch in the next few days,
unless the discussion proves the idea untenable.

> Peter.

View raw message