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 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: Brian Rogoff Subject: Re: OO puzzle Date: 1999/12/31 Message-ID: #1/1 X-Deja-AN: 566905889 References: <386102F6.56CEFA22@averstar.com> <83sq9g$5ml$1@nnrp1.deja.com> <386C07D7.A24A36F5@shadow.net> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 946659466 228 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-31T00:00:00+00:00 List-Id: On Thu, 30 Dec 1999, Jeffrey L Straszheim wrote: > Brian Rogoff wrote: > > > Parameter covariance seemed like a huge mistake of the Eiffel design to > > me. Is it all fixed and working now? > > I have mixed feelings. I've used covariance, and it turns out that I > found it generally useful, even while the holes in the type system > bothered me on a basic level. Kind of like "conservative" (inaccurate) garbage collectors. You know its wrong even though it seems to work most of the time. I preferred Sather's approach, though I admit contravariance isn't "useful" there were acceptable workarounds for covariance. > At a certain abstract level, Ada has a similar issue, in that I can > declare a subtype and, as it turns out, have no formal guarantee that > I won't violate its constraint. In both situations one could make > the effort to prove that a violation will not occur, but in neither > case does the language formally guarantee it. This is really not the same, as Ada subtypes aren't like Eiffel subclasses. Its more appropriate to compare Ada subtypes with array bounds checking and the like. It is interesting that in lots of modern languages with sophisticated type systems the type checking is very hard, sometimes even undecidable. C++ with its templates come to mind, but OCaml's module system also has such problems. -- Brian