comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: How do I create an object instance from a tag?
Date: Wed, 19 Feb 2003 10:18:56 +0100
Date: 2003-02-19T10:18:56+01:00	[thread overview]
Message-ID: <nki65vk98bsb0vrqat5tq5vuidan7cae30@4ax.com> (raw)
In-Reply-To: WXB4a.154645$2H6.2894@sccrnsc04

On Wed, 19 Feb 2003 02:27:03 GMT, "Steve" <nospam_steved94@attbi.com>
wrote:

>What I "thought" was intuitive was something like:
>  myTag : Tags.Tag;
>  value : data_type'class;
>  for Value'Tag use myTag;
>
>Of course that doesn't work.

IMO, the following is more consistent:

   myTag : Tags.Tag := ...;
   value   : data_type'class (myTag);

and for dispatching:

   myTag : Tags.Tag := ...;
   value   : data_type'class (myTag) := Create_Value;

or fully dynamically (qualified expression):

   myTag : Tags.Tag := ...;
   value   : data_type'class :=
       data_type'class (myTag)'(Create_Value);

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2003-02-19  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 20:25 How do I create an object instance from a tag? Steve
2003-02-18  8:29 ` Dmitry A. Kazakov
2003-02-18 18:14   ` Randy Brukardt
2003-02-19  2:27     ` Steve
2003-02-19  9:18       ` Dmitry A. Kazakov [this message]
2003-02-20 15:38 ` Julio Cano
  -- strict thread matches above, loose matches on Subject: below --
2003-02-19  9:39 Grein, Christoph
2003-02-19 13:26 ` Dmitry A. Kazakov
2003-02-19 18:36   ` Randy Brukardt
2003-02-20  9:15     ` Dmitry A. Kazakov
replies disabled

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