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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a5d76152c5cb8790 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: class-wide objects Date: 1998/12/07 Message-ID: #1/1 X-Deja-AN: 419654943 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <366B1190.C8142307@magic.fr> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-12-07T00:00:00+00:00 List-Id: Francois Godme (fgodme@magic.fr) wrote: : ... : An attribute to get the subtype of the actual tagged parameter would : solve both problems. May be we could combine : the two attributes 'Class and 'Tag together: : procedure P4 (S : in Point'Class; : N : in Natural) is : Local : Point'Class (S'Tag); -- allocates an object with the tag of S : subtype T_Local_Point is Point'Class (S'Tag); : Local_Array : array (1 .. N) of T_Local_Point; : begin : ... : end P4; : What do you think ? Am I right or am I missing something ? Could the : GNAT team provide an implementation defined attribute for this ? Just providing the tag is not enough, because the type might have discriminants as well, which must be specified at the point of declaration. One could imagine some new attribute like "'Subtype" and then write: Local : Point'Class(S'Subtype); In fact, something like this was proposed during the Ada 9X revision process, but it didn't make the "cut" among the various language revision proposals. : Francois Godme -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company