comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Re: Type Transcriptions
Date: Mon, 21 Apr 2014 12:51:34 -0600
Date: 2014-04-21T12:51:34-06:00	[thread overview]
Message-ID: <WMd5v.117886$vS2.93071@fx32.iad> (raw)
In-Reply-To: <op.xeoh45nmule2fv@cardamome>

On 21-Apr-14 12:11, Yannick Duchêne (Hibou57) wrote:
> Le Mon, 21 Apr 2014 18:54:23 +0200, Brad Moore <brad.moore@shaw.ca> 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."

  reply	other threads:[~2014-04-21 18:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  7:21 Type Transcriptions Shark8
2014-04-21 16:54 ` Brad Moore
2014-04-21 18:11   ` Yannick Duchêne (Hibou57)
2014-04-21 18:51     ` Shark8 [this message]
2014-04-21 19:42       ` Jeffrey Carter
2014-04-22  6:06         ` Shark8
2014-04-21 20:33       ` Ludovic Brenta
2014-04-21 22:46         ` Adam Beneschan
2014-04-22  8:57         ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox