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,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Abstract Subprograms of Untagged Types Date: 1999/03/05 Message-ID: <36E04AA7.4CB8F686@averstar.com>#1/1 X-Deja-AN: 451699530 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <7bk6gh$6d9$2@plug.news.pipex.net> <7bmgfd$2d3$3@plug.news.pipex.net> <7bp8bk$flc$1@plug.news.pipex.net> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-03-05T00:00:00+00:00 List-Id: Nick Roberts wrote: > I think the example above can be solved at a stroke by making the rule that an > abstract subprogram is never a primitive operation of an untagged type (it's > legal, but never inherited by derivatives of untagged types). One reason we allow abstract primitives of an untagged type is because one way to *disable* a particular primitive that is inherited is to override it with an abstract primitive. For example, if you declare a numeric type like "Meters" then you automatically get an (inappropriate) multiplication operation that goes Meters * Meters => Meters. One use of abstract primitives is to override this operation and thereby make it uncallable. > ... This was a judgement, and fair enough. However, I disagree > with it, and I would like to see the restrictions introduced in the next > revision of Ada. At this point, this seems very unlikely, since someone may be quite happily taking advantage of the ability to declare abstract primitives of an untagged type. > ... But, surely it would be better still to force all compilers > to reject such a confusing construct? I'm not sure I see what is the big deal. It doesn't seem to cause any harm, and it might be useful (as exemplified above). > ... > things, but they should give a warning (or error) when they can tell the > programmer has (almost certainly) done something silly. Identifying things that are harmless but silly can be difficult and is probably more trouble than it is worth in most cases. Identifying things that are likely to cause a run-time error seems much more valuable. > ------------------------------------- > Nick Roberts > ------------------------------------- -- -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