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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33bd7fade7a30a51,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.196.232 with SMTP id ip8mr3720950pbc.6.1339101843232; Thu, 07 Jun 2012 13:44:03 -0700 (PDT) Path: l9ni22682pbj.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: "RasikaSrinivasan@gmail.com" Newsgroups: comp.lang.ada Subject: package Ada.Tags Date: Thu, 7 Jun 2012 13:36:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0067e29b-aceb-4c50-9d62-453c4f549f2e@googlegroups.com> NNTP-Posting-Host: 148.177.1.215 Mime-Version: 1.0 X-Trace: posting.google.com 1339101843 14878 127.0.0.1 (7 Jun 2012 20:44:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 7 Jun 2012 20:44:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.177.1.215; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-06-07T13:36:32-07:00 List-Id: Friends I have two types declared as follows: with Ada.Calendar ; package events is type events_record_type is abstract tagged record time : ada.Calendar.time ; end record ; procedure show(event : events_record_type) ; type basal_delivery_event_type is new events_record_Type with record amount : float ; end record ; overriding procedure show( event : basal_delivery_event_type ) ; type bolus_delivery_event_type is new events_record_Type with record amount : float ; end record ; overriding procedure show( event : bolus_delivery_event_type ) ; type SMBG_event_type is new events_record_type with record amount : short_integer ; end record ; overriding procedure show( event : SMBG_event_type ) ; end events ; The following implementation in the body: procedure show (event : events_record_type) is use GNAT.Calendar.Time_IO; begin put( ada.Tags.Expanded_Name( event'tag ) ); put( gnat.Calendar.time_io.Image( event.time , gnat.Calendar.Time_IO.ISO_Date & " %T")) ; end show; gives me a compilation error: "tag" attribute can only be applied to objects of class - wide type. In the above, isnt event an object meeting this criterion? clearly i am missing something. The question is I want to find out the equivalent of RTTI from C++. ie Which one if the derived types is it. clues appreciated. srini