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!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx32.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:31.0) Gecko/20100101 Thunderbird/31.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Type Transcriptions References: <53554D3F.8050009@shaw.ca> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Mon, 21 Apr 2014 18:51:34 UTC Organization: TeraNews.com Date: Mon, 21 Apr 2014 12:51:34 -0600 X-Received-Bytes: 1945 X-Received-Body-CRC: 2196018092 Xref: news.eternal-september.org comp.lang.ada:19473 Date: 2014-04-21T12:51:34-06:00 List-Id: On 21-Apr-14 12:11, Yannick Duchêne (Hibou57) wrote: > Le Mon, 21 Apr 2014 18:54:23 +0200, Brad Moore a > écrit: > >> I'd suggest trying to make GenericAEADCipher a discriminated record >> type, with the two length values as the discriminants, and then the >> arrays are sized using the discriminants. No Generics needed. >> >> Brad >> > > I guess Shark8 would already have figured it if this could be as simple. > He says this, which is important: “certain class of record-type is > dependent on the values in another record, yet distinctly separate”. > With two separated things, a discriminant is not applicable. Or may be > I've not understood. You have the right of it. Using discriminants is the natural way to do it, but doing so would (in actuality) break sticking to the spec as the record-type would have fields which don't exist in the spec. I suppose the better way to phrase it is: "Is it better to strictly stick to the spec, letting generic instantiation take care of these 'extra-typal' parameters, *OR* doing things the natural Ada way, and worrying about 'fixing-up' things in, say, 'Input and 'Output operations."