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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be02bcdb8f46ddd5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 29 Sep 2004 16:32:15 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <311c6b78.0409271138.1795d07c@posting.google.com> <311c6b78.0409290905.15ae255d@posting.google.com> Subject: Re: An improved Ada? Date: Wed, 29 Sep 2004 16:33:25 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-HzerKq7EA2qYutNh7g7w+p+kA5+9Ys9Uie8/5IXmK7vVaM7aN6FXv4ybu8unocNfaGFlpvC11y1z9LR!KEjQXu67AU7S3W9hJvEbXR6P4IoIlqguaO0devMFSq29yY4rq6boxCcahykiQz8Z0z9hY63Vkitq X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.16 Xref: g2news1.google.com comp.lang.ada:4409 Date: 2004-09-29T16:33:25-05:00 List-Id: "jn" wrote in message news:311c6b78.0409290905.15ae255d@posting.google.com... > I got into a container discussion which was not the intention. > > I want improved OO capabilities in Ada. The way things are results > in having to 'with' base class packages because not all methods seems > to be inherited and also a lot of meaningless safe type conversions that > should have been done by the compiler (my opinion) instead of the programmer. All methods that are in the base package are inherited. You seem to be expecting the named types that happen to use the type to be automatically inherited as well, but these are separate types. To do that in general would be a complete nightmare. Ada 95 does have a problem with use clauses. Ada 2005 solves this with the prefix call notation: Obj.Subprog (...) I'd suggest that your example be written the way real programs are (one tagged type per package), because you can cause problems simply by putting multiple types in one package. I'd also ask that you add comments about what you would expect to be inherited. Otherwise, we can't quite tell what you have in mind. > Are there really any codebases that > applies 'tagged' types and type extension on a larger scale. Not just > wrapping it up in generics. Claw has about 75 tagged types derived in various chains from Root_Window_Type (a tagged abstract type); each of those types resides in its own package. The Claw Builder has a similar structure mirroring that sort of derivation. Virtually all type conversions that we had to write in both of those are not "safe"; they include a check of some sort that we do not expect to fail. But converting from Root_Window_Type'Class to some specific type clearly should be marked in the code. Randy.