From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e044473b43baaf18,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-23 16:04:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-han1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!not-for-mail From: Stephan Heinemann Newsgroups: comp.lang.ada Subject: automatic tag conversion? Date: 23 May 2003 23:04:44 GMT Organization: Technische Universitaet Berlin, Deutschland Message-ID: NNTP-Posting-Host: fiesta.cs.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.cs.tu-berlin.de 1053731084 11152 130.149.17.4 (23 May 2003 23:04:44 GMT) X-Complaints-To: news@cs.tu-berlin.de NNTP-Posting-Date: 23 May 2003 23:04:44 GMT User-Agent: tin/1.4.6-20020816 ("Aerials") (UNIX) (SunOS/5.8 (sun4u)) Xref: archiver1.google.com comp.lang.ada:37722 Date: 2003-05-23T23:04:44+00:00 List-Id: 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