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-18 00:29:05 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!skynet.be!skynet.be!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: Tue, 18 Feb 2003 09:29:04 +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 1045556944 49724519 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:34188 Date: 2003-02-18T09:29:04+01:00 List-Id: On Mon, 17 Feb 2003 20:25:02 GMT, "Steve" wrote: >I would like to create a function that returns a reference to a class wide >object based on the external name. Something along the lines of: > >function Create_Object( external_name : String ) return objAcc is > returnTag : Ada.Tags.Tag; >begin > returnTag := Ada.Tags.Internal_Tag( external_name ); > return ??? some function of returnTag ??? >end Create_Object; > >Can this be done? No, you cannot dispatch on a bare tag without any object. But it seems that this will be changed (soon?). There could be work-arounds in specific cases. For example you could use Ada.Streams for interesting types to define 'Input/'Output so that no data are stored, just the tag. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de