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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.101.91.202 with SMTP id o10mr3097621pgr.49.1500566845788; Thu, 20 Jul 2017 09:07:25 -0700 (PDT) X-Received: by 10.36.29.212 with SMTP id 203mr165517itj.5.1500566845731; Thu, 20 Jul 2017 09:07:25 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!t6no798502itb.0!news-out.google.com!f71ni2791itc.0!nntp.google.com!t6no798499itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 20 Jul 2017 09:07:25 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.113.92.25; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 76.113.92.25 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Why doesn't Ada allow user-defined attributes? From: Shark8 Injection-Date: Thu, 20 Jul 2017 16:07:25 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:47469 Date: 2017-07-20T09:07:25-07:00 List-Id: On Thursday, July 20, 2017 at 3:38:52 AM UTC-6, Brian Drummond wrote: >=20 > Offhand I'm not sure I can see similar purposes for extending Ada's=20 > attributes.=20 >=20 > Got any use cases in mind? Yes; several. First, considering this diagram of types in Ada -- https://upload.wikimedia= .org/wikipedia/commons/c/c2/Ada_types.png -- as well as the descriptions in= the LRM (Annex A in LRM-83, Annex K.2 in LRM-2012), it seems like grouping= these into a hierarchy as shown in the picture might be a good thing. (Tha= t wouldn't necessarily necessitate user-defined attributes... but making su= ch a hierarchy w/o allowing user-defined attributes seems unlikely.) Second, and more intimidate, would be allowing Ada.Containers to implement = a full Array interface, where appropriate. (e.g. having Vector'Length and V= ector'Range; this consistency of interface will be nice as then you wouldn'= t have to remember "I'm using a vector, I have to use V.Length *not* V'Leng= th.")