Re: Re: polynomial ring

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
>><Ring R, RR, T | R<RR> <: T <: R<RR>>
>>class Polynomial<T> implements Ring {
>>    T[] e;
>>    
>>
>This is fun! 
>
>Please step through more slowly:
>- we can't have 'Ring[] e' because Ring is not a type
>  
>
Right.

>- we've said there's some type T; 
>  
>
Right, and that this is the type parameter of the class we are 
declaring, Polynomial.

>- and that type T is a subtype of some other type R that implements the
>abstract interface Ring
>  
>
That T is equal (subtype and supertype) to R<RR>, where R is any class 
that implements Ring, and RR is any type.

>>Apparently, a future version of the type-checker could internally do
>>something similar to handle these cases, and you would not even
>>notice :-)
>>    
>>
>
>In some future version of the type-checker, what sort of thing would we
>write for this to be done internally?
>  
>
abstract interface Ring { ... }

class Polynomial<T> implements Ring { ... }

Daniel



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.