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,d534ff88bae65c48 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: hunting snarks Date: 1999/12/20 Message-ID: <385E8D68.D902D2A4@averstar.com>#1/1 X-Deja-AN: 563115835 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <3856A48D.F4AF4D84@averstar.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-20T00:00:00+00:00 List-Id: Simon Wright wrote: > > Tucker Taft writes: > [...] > > For special cases involving generics which > > declare a type derived from a formal type, there is also a pragma > > Might_Override which overrules Explicit_Overriding, to indicate that the > > given subprogram might or might not override.. > > Doesn't sound like the sort of thing to encourage the safety guys to > let us use all (any of) the good things in Ada! > > Isn't accidental overriding almost bound to lead to error? (wasn't > that the point at which all this started?) When defining a generic "mix-in" it is quite reasonable to have an operation that overrides an inherited operation. It is also just as reasonable to be creating a new operation. It really requires knowledge of the particular instantiation in some cases, and clearly you don't have that knowledge when writing the generic itself. So that is what this pragma is used for. The pragma is not to be read as "allow accidental overriding" but rather as "allow intentional overriding upon instantiation." For anyone instantiating the generic, this is presumably a flag to indicate that some additional care may be required here. Without the pragma, you might be forced to create two versions of the same generic, one with a pragma Overrides, and one without, which definitely seems like overkill in some situations. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA