comp.lang.ada
 help / color / mirror / Atom feed
From: Stephan Heinemann <zombie@cs.tu-berlin.de>
Subject: automatic tag conversion?
Date: 23 May 2003 23:04:44 GMT
Date: 2003-05-23T23:04:44+00:00	[thread overview]
Message-ID: <bam9ec$asg$1@news.cs.tu-berlin.de> (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



             reply	other threads:[~2003-05-23 23:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-23 23:04 Stephan Heinemann [this message]
2003-05-23 23:57 ` automatic tag conversion? 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
replies disabled

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