develooper Front page | perl.perl6.language | Postings from March 2005

Re: Adding linear interpolation to an array

Thread Previous | Thread Next
From:
Thomas Sandlaß
Date:
March 10, 2005 08:54
Subject:
Re: Adding linear interpolation to an array
Message ID:
42307B96.9060702@orthogon.com
HaloO Luke,

you wrote:
> The words 'covariant' and 'contravariant' in this context seem like
> voodoo math.  Please explain what you mean.

'Co' means together like in coproduction. And 'contra' is the opposite
as in counterproductive. With instanciating parametric types the question
arises how a subtype relation between instanciating types propagates
to the template. E.g with Int <: Num, covariance would result in
Array[Int] <: Array[Num]. Referential classes are actually quite difficult
because upon write they are contravariant and covariant when read!
So a third case of uncomparable types is needed as well, or it is the default
if nothing else is specified.


> That's not true.  I don't believe it would be an error to specify
> all nine combinations.

Ohh, sorry. Of course implementing all is fine as well. But a bit
tedious for larger collections of classes.


MfG
-- 
TSa (Thomas Sandlaß)



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About