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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin2!goblin.stu.neva.ru!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Jacob Sparre Andersen news" Newsgroups: comp.lang.ada Subject: Re: Seeking for papers about tagged types vs access to subprograms Date: Tue, 7 May 2013 15:27:58 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1luaso698dpcc$.rrv8385qwl92.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1367958481 13129 69.95.181.76 (7 May 2013 20:28:01 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 7 May 2013 20:28:01 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 3006 Xref: number.nntp.dca.giganews.com comp.lang.ada:181485 Date: 2013-05-07T15:27:58-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1luaso698dpcc$.rrv8385qwl92.dlg@40tude.net... >> On Mon, 6 May 2013 20:09:46 -0500, Randy Brukardt wrote: >> >>>The idea of indexing a numeric type is silly, >> >> Not at all, consider Unit type declared modular because it has to be used >> as a discriminant. At the same time Unit is a composite of powers for >> mass, >> time, current, temperature etc. One would like to have it indexed (viewed >> as an array or as a record). It might make sense to view it as a record (a capability not in Ada 2012), but it makes little sense to view it as an array (a list of identical components indexed by a potentially *computed* index). There are a lot of abuses of arrays out there that would be much better written as records. > Another problem is that you cannot make everything Controlled without MD. > Because otherwise you will permanently run into problems with primitive > operations of multiple types, multi-methods etc. Say what? Making everything controlled simply means that every type has a Finalize operation. Dispatching *within* a Finalize operation is usually a disaster (you don't want to redispatch as you might be finalizing the parent part of some child type), so what that has to do with MD is beyond my comprehension. I suppose you might get into trouble if you mistakenly try to declare multiple tagged types in a package, but that's always a bad idea and should be avoidable in almost all cases (possibly with careful use of limited with). If you really need multiple types in a package, you have too much coupling between "objects" (in an OO sense), and coupling is always something to be minimized. Randy.