comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pchapin@sover.net>
Subject: Re: Subtype conformance... not what I was expecting.
Date: Wed, 26 Jul 2006 20:02:53 -0400
Date: 2006-07-26T20:02:53-04:00	[thread overview]
Message-ID: <44c802a7$0$2922$4d3efbfe@news.sover.net> (raw)
In-Reply-To: <1153928329.4980.14.camel@localhost>

Georg Bauhaus wrote:

> Let F : Person -> Room and G : Girl -> Girls_Dormitory.
> Then Person -> Room is a subtype of Girl -> Girls_Dormitory (that is,
> Person->Room <: Girl->Girls_Dormitory) iff Room <: Girls_Dormitory
> and Girl <: Person.
> 
> Let F : Girl -> Girls_Dormitory and G : Person -> Room.
> Then Girl -> Girls_Dormitory is a subtype of Person -> Room (that is,
> Girl->Girls_Dormitory <: Person->Room) iff Girls_Dormitory <: Room
> and Person <: Girl.

Yes, this is what I was getting at: covariance and contravariance. I 
think what you say above is correct. However, it is not intuitive for 
Room <: Girls_Dormitory or for Person <: Girl.

Peter



  reply	other threads:[~2006-07-27  0:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-26  3:02 Subtype conformance... not what I was expecting Peter C. Chapin
2006-07-26  6:58 ` Craig Carey
2006-07-26  7:54 ` Dmitry A. Kazakov
2006-07-26 14:32   ` Peter C. Chapin
2006-07-26 15:38     ` Georg Bauhaus
2006-07-27  0:02       ` Peter C. Chapin [this message]
2006-07-26 18:40     ` Dmitry A. Kazakov
2006-07-27  0:00       ` Peter C. Chapin
2006-07-26  8:06 ` Georg Bauhaus
2006-07-26 14:15   ` Peter C. Chapin
2006-07-26 21:23 ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox