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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cfa83146b0781ed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-15 01:29:08 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!swiss.ans.net!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: comar@cs.nyu.edu (Cyrille Comar) Newsgroups: comp.lang.ada Subject: Re: Overloading for T and T'Class Date: 15 Nov 1994 00:01:46 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3a9fbq$27v@lang8.cs.nyu.edu> References: <3a6goo$j7s@Starbase.NeoSoft.COM> NNTP-Posting-Host: lang8.cs.nyu.edu Date: 1994-11-15T00:01:46-05:00 List-Id: dweller@Starbase.NeoSoft.COM (David Weller) writes: : In article , : John Volan wrote: : >In Ada9X, is it legal to overload the same subprogram name for both : >some tagged type T and its class-wide type T'Class? For example: : > : > package P is : > type T is tagged ... ; : > procedure Op (X : in out T); : > procedure Op (X : in out T'Class); : > ... : > end P; : > : : As a compiler, your declarations would confuse me, since the first Op : says "I'm a primitive operation, and thus I may be extended and : modified by descendants", and the second one says, "I'm a classwide : operation, thus any descendant of my type (a member of T'Class) must : execute this subprogram". A contradiction, from my perspective. : : I think GNAT (at the moment) permits this, further confusing the : issue. My understanding (without checking the RM...) is that the above declarations are legal but that any USE of "Op" would be ambiguate, so it is really useless... I am not completely sure though... -- ------------------------------------------------------------------------ Cyrille Comar, E-mail: comar@cs.nyu.edu Gnat Project US phone: (212) 998-3489