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

Re: Adding linear interpolation to an array

Thread Previous | Thread Next
Thomas Sandlaß
March 10, 2005 08:54
Re: Adding linear interpolation to an array
Message ID:
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.

TSa (Thomas Sandlaß)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About