comp.lang.ada
 help / color / mirror / Atom feed
From: Mike H <postmaster@ada-augusta.demon.co.uk>
Subject: Re: A question about private types
Date: Thu, 12 Jun 2014 19:11:09 +0100
Date: 2014-06-12T19:11:09+01:00	[thread overview]
Message-ID: <4pQF1fF90emTFwjr@ada-augusta.demon.co.uk> (raw)
In-Reply-To: lncnhn$e4i$1@dont-email.me

In message <lncnhn$e4i$1@dont-email.me>, Jeffrey Carter 
<spam.jrcarter.not@spam.not.acm.org> writes
>A private type can't be used as an array index as you're doing here, 
>however. Perhaps that's really what you're complaining about.
>
>Even if Grid_Index_Type were private, Address could still be changed.
>
>Address would be harder to change if it were a discriminant:
>
>type Cell_Type (Address: Grid_Index_Type := Some_Initial_Value) is record
>    Data : Cell_Data;
>end record;
>
Thanks, perhaps I'll take a closer look at that. It may also solve a 
second niggling worry. If Grid_index_type is a subtype of some type that 
is range 0..81 then Some_initial_value = 0 could be used to flag an 
un-initialised grid.
-- 
Time flies like an arrow. Fruit flies like a banana.
Mike

      reply	other threads:[~2014-06-12 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 15:03 A question about private types Mike H
2014-06-12 15:21 ` Adam Beneschan
2014-06-12 17:20 ` Jeffrey Carter
2014-06-12 18:11   ` Mike H [this message]
replies disabled

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