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: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: jsa@alexandria (Jon S Anthony) Subject: Re: OO, C++, and something much better! Date: 1997/01/10 Message-ID: #1/1 X-Deja-AN: 209117285 sender: news@organon.com (news) references: organization: Organon Motives, Inc. newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-10T00:00:00+00:00 List-Id: In article donh@syd.csa.com.au (Don Harrison) writes: > Jon S Anthony writes: > > :This too is in Ada95: > : > :generic > : type G is new Comparable with private; > :package Sorted_List is ... > : > :Same instantiation constraints as in the Eiffel case... > > Yes. However, I'm not sure whether you lose some of the power of combining > genericity with inheritance through Ada's module-type distinction. I have never seen any example supporting your "unease" - by you or anyone else. > genericity in Ada is essentially module-based and inheritance is type-based, > I suspect you may lose something here. Presumably you forgot to add "only" to "inheritance is type-based". But this is just plain false. Counter-examples are everywhere. > :> - True static typing (with no cast a la C++). > : > :Yes, this is in Ada95 too. > > No. Ada offers type casting in a couple of ways: > > 1) UNCHECKED_CONVERSION and > 2) Address representation clauses (overlays). 1. This is not "casting" 2. It's irrelevant anyway as these are type system trap doors (outside the type system). 3. Ada _is_ statically safer than Eiffel as it avoids broken polymorphism. > Eiffel, by contrast, has no such thing in the standard language. That isn't Irrelevant. > :In fact it is better in Ada95 since it > :does not have system validity problems. > > Perhaps not the same kind of problems. But it's dead easy to write 'system > invalid' Ada which will result in runtime errors. Only if you _intentionally_ do so - by using UC in a dodgy way. You won't get it "by accident". > For example, by using the value of a parent type where a subrange > value is required. Give an example. This sort of thing will be statically checked. > :Here is where you actually get some more flexibility with Ada as you > :can parameterize your generic (either the constrained or unconstrained > :type) with more than just types. You can specify complete signatures > :including operations and/or packages as well. What's more, these can > :have constraints on them as well. > > Yes. However, these kinds of formal parameters are only needed in Ada because > it distinguishes between module and type. Nah. That's irrelevant to why they are there. They are there, as Rober Eachus points out, because you have the flexibility of not _only_ organizing your structures strictly hierarchically. Or _only_ on type. > simpler because it is a *pure* OOPL compared to hybrid Ada. Pure, schmure. No programming language is "pure" in my estimation. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com