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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx19.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:32.0) Gecko/20100101 Thunderbird/32.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Comments requested for a couple of Ada-Comments submissions References: <58Kvv.9105$Zt3.1101@fx02.iad> <61zr552fwaif$.1gzem1sdpvtac.dlg@40tude.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Fri, 11 Jul 2014 21:46:31 UTC Organization: TeraNews.com Date: Fri, 11 Jul 2014 15:46:33 -0600 X-Received-Bytes: 2404 X-Received-Body-CRC: 2773434281 Xref: news.eternal-september.org comp.lang.ada:20886 Date: 2014-07-11T15:46:33-06:00 List-Id: On 11-Jul-14 15:24, Randy Brukardt wrote: > This is roughly what GNAT is doing, and I think this is horrible. An > attribute is some sort of function, and it would never be possible to write > a function that works like this. I don't want more magic in the language if > we can help it. Moreover, this ought to have the semantics of an aggregate > (vis-a-vis temporaries, build-in-place, and the like), and as such it ought > to look like an aggregate. I agree -- I think this should not be an attribute, nor the addition of new keywords. Perhaps something along the lines of Extension Aggregates [ref 4.3.2]. -- Reminder -- extension_aggregate ::= (ancestor_part with record_component_association_list) ancestor_part ::= expression | subtype_mark -- New Syntax -- partial_aggregate ::= (modified_part with all others => <>) where modified_part denotes the portion being updated, in list/alternate form... -- Given record a containing integer fields B, C, D: A:= (B => 1, D => 2 with all others => <>); -- Given bit-array A with indices 1..16: A:= (1..4 => 1, 9..16 => 0 with all others => <>); It obviously wouldn't work on a unconstrained array-type initialization, where the variable would try to get its constraints from the right-hand side, but considering the intended use I don't see why that would be a bad thing. Just an idea.