Personal view about catcall solution

Revision as of 21:30, 22 June 2007 by Juliant (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

--Juliant 07:30, 23 June 2007 (CEST)

As explained in the general remarks section, you need to be able to express contravariance to be able to correctly model agents and comparator objects. For this reason, I suggest using the usage-site variance for generics since it is powerful enough to model the agents right.

As this only solves the case of generics, another solution has to be used for non-generic types. Again, the general remarks section explaines that another solution is needed to solve the catcall problem of non-generic types as otherwise the expressiveness of the programmer is restricted if the covariantly redefined features (e.g. is_equal) and the features with formal generic parameters (e.g. put) are treated the same.

For this reason I suggest using the DOG proposal for non-generic covariance. Although this may restrict the use of covariance severly as you need to know in advance which features can be used covariantly, it still allows features to declare parameters as like Current and thus implicitly as covariant.