comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Tasks, Entries, and Variables of a Class-wide type
Date: Mon, 01 Nov 2010 13:49:08 -0700
Date: 2010-11-01T13:49:08-07:00	[thread overview]
Message-ID: <ian9ib$7rl$1@tornado.tornevall.net> (raw)
In-Reply-To: <958760a1-b26b-4641-be4c-b742c2e0e836@u10g2000yqk.googlegroups.com>

On 11/01/2010 12:28 PM, Shark8 wrote:
>
> Ah, you mean something like a Variant-record? Or am I misunderstanding
> you?
>
> Type Object_Type is ( ps_Interger, ps_Character, ps_Name [etc] );
> Type PostScript_Object( Type_Discriminant : Object_Type ) is Record
>    Case Type_Discriminant is
>      When ps_Interger  =>  Integer_Value : Integer;
>      When ps_Character =>  Character_Value : Character;
>      When ps_Name      =>  String_Value: String; -- Not allowed,
> unconstrained type
>    end case;
> end record;

Unbounded_String would be suitable, though. And you want a default on the 
discriminant, so that you can declare an unconstrained object, pass it as the 
actual to an out-mode parameter, and allow it to be assigned to with a different 
discriminant.

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49



  reply	other threads:[~2010-11-01 20:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01  5:40 Tasks, Entries, and Variables of a Class-wide type Shark8
2010-11-01  9:21 ` Dmitry A. Kazakov
2010-11-01 15:30   ` Shark8
2010-11-01 18:50     ` Jeffrey Carter
2010-11-01 19:23       ` Dmitry A. Kazakov
2010-11-01 20:08         ` Georg Bauhaus
2010-11-01 20:56           ` Dmitry A. Kazakov
2010-11-01 19:28       ` Shark8
2010-11-01 20:49         ` Jeffrey Carter [this message]
2010-11-05 12:43         ` Robert A Duff
replies disabled

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