comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <rm-dash-bau-haus@dash.futureapps.de>
Subject: Re: Need help for constrained type
Date: Mon, 10 Feb 2014 12:40:29 +0100
Date: 2014-02-10T12:40:22+01:00	[thread overview]
Message-ID: <52f8baa6$0$6655$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <cpWjMXDemO9SFw7C@ada-augusta.demon.co.uk>

On 07.02.14 15:11, Mike H wrote:
> In message <52f3c83c$0$6559$9b4e6d93@newsspool4.arcor-online.net>, G.B.
> <rm-dash-bau-haus@dash.futureapps.de> writes
>> One approximation can make use of generics. The immediate
>> mention of the Len with the object declaration will not be
>> present. But otherwise the approximation preserves the
>> "interface" of Memory_Block, except that the .Len component
>> is no longer constant, and not guaranteed to be in sync with
>> the length of .Usage_Info, if someone messes with it.
> Cannot sync be guaranteed by placing the relevant bits and pieces as
> private types within a package such that they may only be manipulated by
> functions and procedures provided by that package? Or have I
> misunderstood something?

I suppose the .Len component could be removed from the record
entirely, and be replaced with a constant function Len .IFF.
the record does not need to be some skinny collection of names
to be used without functions, taking pointers and overwriting
memory locations with index values/offset values.
(Used from both the Ada side and from the C side.)



  reply	other threads:[~2014-02-10 11:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 16:13 Need help for constrained type Gerd
2014-02-06 17:30 ` Niklas Holsti
2014-02-06 18:03   ` adambeneschan
2014-02-06 18:37     ` Niklas Holsti
2014-02-06 18:57       ` adambeneschan
2014-02-06 17:37 ` G.B.
2014-02-07 14:11   ` Mike H
2014-02-10 11:40     ` G.B. [this message]
2014-02-07  0:04 ` Jeffrey Carter
replies disabled

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