comp.lang.ada
 help / color / mirror / Atom feed
* automatic tag conversion?
@ 2003-05-23 23:04 Stephan Heinemann
  2003-05-23 23:57 ` Stephan Heinemann
  0 siblings, 1 reply; 8+ messages in thread
From: Stephan Heinemann @ 2003-05-23 23:04 UTC (permalink / raw)


I would like to convert a Subtype of a tagged Supertype stored in a
variable of Supertype into a variable of Subtype. I do not want to
use the following:

if supervar'Tag = "Subtype" then
	polymorphic(Subtype(supervar));
elsif ...
else ...
end if;

Isn't there anything like:

t: Tag;
subvar: Subtype;
...
t := supervar'Tag;
subvar := t'convert(supervar); -- convert(t, supervar)
polymorphic(subvar);

?

It is because I would like to extend the Supertype and use dynamic
binding / polymorphism for the appropriate variable of Subtype without
having to do this String mess.

Thanks in advance,
Stephan



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-05-26 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-23 23:04 automatic tag conversion? Stephan Heinemann
2003-05-23 23:57 ` Stephan Heinemann
2003-05-24 17:39   ` Georg Bauhaus
2003-05-25 20:59     ` Stephan Heinemann
2003-05-26  8:29       ` Dmitry A. Kazakov
2003-05-26 18:16         ` Georg Bauhaus
2003-05-26 18:27           ` Georg Bauhaus
2003-05-26 20:49             ` Stephan Heinemann

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