info-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Co-/Contravariance (was: mandatory newbie musing)


From: Norbert Nemec
Subject: Re: Co-/Contravariance (was: mandatory newbie musing)
Date: Mon, 2 Oct 2000 23:41:26 +0200
User-agent: Mutt/1.0.1i

On Mon, Oct 02, 2000 at 09:01:10PM +0000, Matt Kennel wrote:
> My opinion on the whole co versus contra thing, having programmed a reasonable
> amount in both Eiffel and Sather. 
> 
> Contravariance is always type safe, and checkable at compile time, and
> theoretically nice, but in practice, not useful.
> 
> Covariance is not those things, but seems to be more useful.  

What's that? Both are perfectly simple to check at compile time. They 
are not even very complex. Without those concepts you would simply have 
to keep every type exactly in subtype members. This way, you have a 
little bit more freedom, which of course you may ignore.

At worst, it is just a tiny little feature of the language that does not
cost much, but I think it really is worth something. It is hard to show 
a simple example from everydays use, but I have used the feature and I 
really was glad it was there.

> This leads me to conclude that an entirely new concept and clever
> design is needed.

I don't agree! The concept is simple, straightforward and clever. Only 
because it has those strange names of contra- and covariance it need 
not necessarily be complex.

> If you want my other gratuitious opinions about Sather versus Eiffel
> schismology, I generally like Sather more than Eiffel in various non
> type-systemish ways, for instance ::= is clean and lovely and I think the
> overloading of Sather is fine.  And of course iters!

And it is just those tiny pieces like contra-/covariance and many more, 
that show that someone really though it through.

Ciao,
Nobbi

-- 
-- ______________________________________________________
-- JESUS CHRIST IS LORD!
--          To Him, even that machine here has to obey...
--
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44  ...  D-91054 Erlangen  ...  Germany
-- eMail: <address@hidden>   Tel: +49-(0)-9131-204180



reply via email to

[Prev in Thread] Current Thread [Next in Thread]