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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Why doesn't Ada allow user-defined attributes? Date: Fri, 21 Jul 2017 04:46:04 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 21 Jul 2017 04:46:04 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="4fdfec9d0c2d6b2d074e3456a08dba6f"; logging-data="8547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sCF1sMTb5rPtUy9EOQLXJN50PwI3Qn9c=" User-Agent: NewsTap/5.2.6 (iPhone/iPod Touch) Cancel-Lock: sha1:JichfoWbJbPm+wp5KKCx3Fao18Y= sha1:h944zDVM5OwhCIshTwPn/TkroRs= Xref: news.eternal-september.org comp.lang.ada:47481 Date: 2017-07-21T04:46:04+00:00 List-Id: Shark8 wrote: > On Thursday, July 20, 2017 at 3:38:52 AM UTC-6, Brian Drummond wrote: >> >> Offhand I'm not sure I can see similar purposes for extending Ada's >> attributes. >> >> Got any use cases in mind? > > Yes; several. > > > Second, and more intimidate, would be allowing Ada.Containers to > implement a full Array interface, where appropriate. (e.g. having > Vector'Length and Vector'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'Length.") > Do you really need 'Length? It seems an implementation detail whenever the language doesn't have forall or exists. So, I'd rather want to use arrays with the generalized iteration scheme. (Granted, I don't need to write Binary Search etc.)