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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33bd7fade7a30a51 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.132.81 with SMTP id a17mr947446bkt.4.1339105700627; Thu, 07 Jun 2012 14:48:20 -0700 (PDT) Path: e27ni25098bkw.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: "RasikaSrinivasan@gmail.com" Newsgroups: comp.lang.ada Subject: Re: package Ada.Tags Date: Thu, 7 Jun 2012 14:48:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3a03daff-725c-4455-b447-e4e5412b4d51@googlegroups.com> References: <0067e29b-aceb-4c50-9d62-453c4f549f2e@googlegroups.com> NNTP-Posting-Host: 148.177.1.215 Mime-Version: 1.0 X-Trace: posting.google.com 1339105700 22705 127.0.0.1 (7 Jun 2012 21:48:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 7 Jun 2012 21:48:20 +0000 (UTC) In-Reply-To: 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-07T14:48:20-07:00 List-Id: Thanks. It worked. The question of exact application is valid of course and requires thinking. cheers, srini On Thursday, June 7, 2012 5:35:11 PM UTC-4, Simon Wright wrote: > "RasikaSrinivasan@gmail.com" writes: > > > 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. > > You can get it to compile by converting the object 'event' of a specific > type to the class-wide type: > > Events_Record_Type'Class (Event)'Tag > > But, how are you going to get Show(Events_Record_Type) to be called?