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: a07f3367d7,aaabba5db6b5df34 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Min/Max attribute makes promises it can't keep Date: Wed, 28 Apr 2010 16:07:24 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <98b7e6f2-32ed-465c-9a52-541b7878ca86@y17g2000yqd.googlegroups.com> <9b17e781-f46a-4384-8809-b16602d10114@y30g2000yqh.googlegroups.com> <880dc0f0-7fff-440d-8aad-6ce745fcfed8@h27g2000yqm.googlegroups.com> <246a7cec-bd5f-4c48-a6cb-3874080c19ab@y17g2000yqd.googlegroups.com> <591866ec-fa46-440c-b6fc-3092985ae3df@r27g2000yqn.googlegroups.com> <8ab2d2d1-b7dc-47bf-824f-4cab334a3fd6@11g2000yqr.googlegroups.com> <1pbp1hhh5yb9k.b6b9xs33b4od$.dlg@40tude.net> <4bd841e7$0$7658$9b4e6d93@newsspool1.arcor-online.net> <1t4extnm6iluj.r4x652cntogc$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1272488847 18472 69.95.181.76 (28 Apr 2010 21:07:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 28 Apr 2010 21:07:27 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:11239 Date: 2010-04-28T16:07:24-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1t4extnm6iluj.r4x652cntogc$.dlg@40tude.net... > On Wed, 28 Apr 2010 16:10:46 +0200, Georg Bauhaus wrote: > >> On 28.04.10 15:41, Dmitry A. Kazakov wrote: >> >>> Well, the proposal might be to fix rather the issue of the superfluous >>> subtype specification. Obviously Max (and many other attributes) are >>> primitive operations and need no subtype to specify. So: >>> >>> X'Succ, X'Pred, X'Image >> >> That'll be fun: >> >> C'Succ'Succ >> >> 'C'&'&''Succ >> >> ''''Succ >> >> (M + N)'Succ > > This is a slightly different design flaw. Things like "abc"'Length, > "abc"'First are illegal in Ada. No fun! That's not a real problem. Ada 2012 will allow String'("abc")'Length As a qualified expression can be used as a name (it's considered constant). If you think this is weird, Tucker points out that you can already write: String(String'("abc"))'Length in Ada 95, as a type conversion is a name. We did wonder if any compilers could actually handle it, but given that this long-winded locution is already legal, the shorter one might was well be legal as well. As for the initial concern about giving a subtype name, in the case of literals you have to give one somewhere (since a literal can be of many different types, and the results can vary depending on the type used -- not for 'Length, but for 'Last and most other properties). We did talk a bit about object attributes like suggested back a few messages for Ada 2012. We didn't get much consensus, mainly because I think people were looking at the wrong questions. Randy.