comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
To: comp.lang.ada@ada.eu.org
Subject: Re: How do I create an object instance from a tag?
Date: Wed, 19 Feb 2003 10:39:56 +0100 (MET)
Date: 2003-02-19T10:39:56+01:00	[thread overview]
Message-ID: <mailman.20.1045648099.9948.comp.lang.ada@ada.eu.org> (raw)

Problem with this proposal is abstract types. There must not be objects of an 
abstract type.

So if myTag denotes an abstract type, the proposal is illegal. It should at 
least propagate Program_Error.

So there are good reasons why there is not yet a solution for this problem.

(A solution, together with some trivial other amendments, could be used to find 
the nearest common ancestor of two tagged objects. Currently there is no way to 
find it.)

> 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);



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

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

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