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,1e0472f55fc12a52 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-19 01:18:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: How do I create an object instance from a tag? Date: Wed, 19 Feb 2003 10:18:56 +0100 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1045646336 50422741 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:34221 Date: 2003-02-19T10:18:56+01:00 List-Id: On Wed, 19 Feb 2003 02:27:03 GMT, "Steve" 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