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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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:48:21 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!proxad.net!freenix!enst.fr!not-for-mail From: "Grein, Christoph" Newsgroups: comp.lang.ada Subject: Re: How do I create an object instance from a tag? Date: Wed, 19 Feb 2003 10:39:56 +0100 (MET) Organization: ENST, France Message-ID: Reply-To: "Grein, Christoph" , "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1045648100 6692 137.194.161.2 (19 Feb 2003 09:48:20 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 19 Feb 2003 09:48:20 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: drWBq5RJTSlKJs3OCZG0ew== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:34222 Date: 2003-02-19T10:39:56+01:00 Problem with this proposal is abstract types. There must not be objects of an abstract type. So if myTag denotes an abstract type, the proposal is illegal. It should at least propagate Program_Error. So there are good reasons why there is not yet a solution for this problem. (A solution, together with some trivial other amendments, could be used to find the nearest common ancestor of two tagged objects. Currently there is no way to find it.) > 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);