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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Seeking for papers about tagged types vs access to subprograms Date: Mon, 6 May 2013 20:09:46 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367888992 15702 69.95.181.76 (7 May 2013 01:09:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 7 May 2013 01:09:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2907 Xref: number.nntp.dca.giganews.com comp.lang.ada:181468 Date: 2013-05-06T20:09:46-05:00 List-Id: "Yannick Duchêne (Hibou57)" wrote in message news:op.wwnp2zkrule2fv@cardamome... ... >I also looked at the RM about user-defined indexing, and could not find a >reason why it is legal for tagged types only. May be I will understand a >future day why it requires a tagged type, so far, it makes me feel it's >lacking orthogonality. It's simply a matter of practicality. We considered allowing them for all non-array types, but the problem is that you don't know whether a particular type is an array type unless you break privacy (a huge no-no for Legality Rules). And then you get into the problem of having both predefined and user-defined indexing for a particular type, and which one is used in a particular case. You can invent some really insane cases by using the "additional operation" rules (where indexing might only appear in the body or other very late points). Steve Baird had some head-exploding examples. We avoided the entire problem by only allowing this on tagged types, as there are no tagged array types. It's not a perfect solution, but its the most we could practically do for Ada 2012 (if this was any more complex, it would have been deep-sixed, that is, killed). As a practical matter, I think almost all new composite types ought to be derived from Controlled (or Limited_Controlled), meaning that they're tagged, so this restriction doesn't matter much. (The idea of indexing a numeric type is silly, array types don't need user-defined indexing, and nobody should be declaring visible access types anyway, so nothing is left.) YMMV. Randy.