comp.lang.ada
 help / color / mirror / Atom feed
From: Per Sandberg <per.sandberg@sandat.dyndns.org>
Subject: Re: Variant record limitation - what's a better solution?
Date: Wed, 3 Jul 2013 22:55:24 +0200
Date: 2013-07-03T22:55:24+02:00	[thread overview]
Message-ID: <20130703225524.00f9dcbc@lufsen.sandat.dyndns.org> (raw)
In-Reply-To: 0606a658-9816-4611-84dd-4f999bf6018e@googlegroups.com

Just curious.

This is how you want to do something, and if you want a deeper answer
why not try to state what you want to do on a higher level since Ada is
a high level language.

/Persan



On Wed, 3 Jul 2013 00:52:12 -0700 (PDT)
Peter Brooks <peter.h.m.brooks@gmail.com> wrote:

> I see that I can't do what I'd like to with a variant record. What
> should I be doing?
> 
> Here's an example:
> 
> type
> my_object(X : size_type) is
>        record
>               name : string(1..80);
>               case X is
>                  when small => Y : small_type; -- line 20
>                  when medium => Y : medium_type; -- line 21
>                  when large => Y: large_type; -- line 22
>               end case;
>        end record;
> 
> The errors are:
> line 21  'Y' conflicts with declaration at line 20
> line 22 'Y' conflicts with declaration at line 21
> 
> I was hoping to have a different type depending on the case, but this
> doesn't seem allowed. What would achieve this?


  parent reply	other threads:[~2013-07-03 20:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03  7:52 Variant record limitation - what's a better solution? Peter Brooks
2013-07-03  8:11 ` Georg Bauhaus
2013-07-03  9:39   ` Peter Brooks
2013-07-03 16:23 ` Jeffrey Carter
2013-07-03 18:35 ` Shark8
2013-07-03 19:26 ` Adam Beneschan
2013-07-09 11:48   ` Peter Brooks
2013-07-09 15:11     ` Adam Beneschan
2013-07-10  1:11       ` Peter Brooks
2013-07-03 20:55 ` Per Sandberg [this message]
2013-07-09  6:38 ` Peter Brooks
2013-07-09  7:49   ` Simon Wright
2013-07-09  8:22   ` Georg Bauhaus
2013-07-09 14:12   ` Eryndlia Mavourneen
replies disabled

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