From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c5ca2cbae60e9fee X-Google-Attributes: gid103376,public From: Ehud Lamm Subject: Re: OO puzzle Date: 1999/12/25 Message-ID: <8420mi$hnp$1@nnrp1.deja.com>#1/1 X-Deja-AN: 564737447 References: <83qtap$pri$1@nnrp1.deja.com> <83sqht$5oi$1@nnrp1.deja.com> <83tb9t$g8e$1@nnrp1.deja.com> X-Http-Proxy: 1.0 o-proxy.cc.huji.ac.il:8080 (Squid/2.2.STABLE4), 1.0 x40.deja.com:80 (Squid/1.1.22) for client 132.64.12.10, 132.64.1.34 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sat Dec 25 08:56:42 1999 GMT X-MyDeja-Info: XMYDJUIDehudlamm Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Date: 1999-12-25T00:00:00+00:00 List-Id: In article <83tb9t$g8e$1@nnrp1.deja.com>, Ted Dennison wrote: > In article <83sqht$5oi$1@nnrp1.deja.com>, > Ehud Lamm wrote: > > In article <83qtap$pri$1@nnrp1.deja.com>, > > Ted Dennison wrote: > > > if d not in truck_driver'class then > > > raise Constraint_Error; > > > end if; > > > > > > > Right. But than we are dealing with a runtime check. See the > > discussion per Tucker's post. > > Well...yes. But even if the language directly supported MI, this would > have to be a runtime check in many situations. Situations where it > doesn't dynamicly dispatch might be determinable at compile time, but in > those situations you don't need straight inheritance either. I am not sure why you restrict the issue to MI. The hierarchy of vehicles and drivers was SI. The difference is that you have covariance on paramters that are not of the class being extended. Note that this is clearly apperant - becuase of the "distinguished receiver." > > The real drawback in my mind is that the type constraint isn't visible > in the procedure's spec. You'd have to copiously comment it, but > comments aren't checked by the compiler. Quite. This is an important issue, and relates to expresability. -- Ehud Lamm mslamm@mscc.huji.ac.il http://purl.oclc.org/NET/ehudlamm Check it out and subscribe to the E-List Sent via Deja.com http://www.deja.com/ Before you buy.