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: 10261c,cfbb90c56a313e70 X-Google-Attributes: gid10261c,public X-Google-Thread: 103376,cfbb90c56a313e70 X-Google-Attributes: gid103376,public From: Al Christians Subject: Re: From extended Pascals to Ada 95 guide Date: 2000/08/28 Message-ID: <39AA8FFB.C9549B55@easystreet.com>#1/1 X-Deja-AN: 663522811 Content-Transfer-Encoding: 7bit References: <8o3s2a$9ph$1@nnrp1.deja.com> <8o4bfq$v0h$1@slb7.atl.mindspring.net> <8obv01$7hu1@news.cis.okstate.edu> <39A991F3.A8D8BED7@easystreet.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Trillium Resources Corporation MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.pascal.misc Date: 2000-08-28T00:00:00+00:00 List-Id: Marco van de Voort wrote: > > In article <39A991F3.A8D8BED7@easystreet.com>, Al Christians wrote: > > > >The principal criterium is size of the language definition/reference > >manual. Modula-3's is under 60 pages, IIRC, much smaller than Ada's. > >And Wirth was some kind of advisor to the M3 design team. > > Why is that the principal criterium? > Because a concise language definition has been a design goal of the Wirth-type languages. The last, Oberon-2, was considered a successful design because it got this down to about 15 pages. > >All three of these languages, M2, M3, and Ada, now support generics, > >and that gives them a big advantage over Delphi for coding without doing > >aribtrary conversions between data types. > > Could you elaborate on this? > > > Of course in a standard Delphi program those stress tested VCL > classes are used mostly. > If I define my own type in a Pascal program and want to save it in one of the VCL containers, the code would look like this: { To Insert } AContainer.Objects[i] := Pointer(MyObject); { To Retrieve } MyObject := TMyObject(AContainer.Objects[i]); The compiler can't check if the conversion of type from Pointer back to TMyObject is applicable. Some typographical or thinkographical error causing an object of the wrong type to be converted to a Pointer when inserting is not detected until retrieval at run time. Delphi is far from the worst offender in this regard. Look at any book on COM programming in C++, and you see about three programmer specified conversions in each four lines of code. It's almost like programming with no user-defined types at all. In Ada, this would be done with generic containers, and no type conversions would be required. By defining languages with strict rules for type conversions, Wirth made progress against certain kinds of errors. By giving us ways around the rules, Borland made Wirth's languages practical for day-to-day use. Generics in Ada, M3, and now M2, combine good features from each approach. Al