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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,33bd7fade7a30a51 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.104 with SMTP id gp8mr4011297pbc.4.1339104997884; Thu, 07 Jun 2012 14:36:37 -0700 (PDT) Path: l9ni22935pbj.0!nntp.google.com!news1.google.com!goblin3!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: package Ada.Tags Date: Thu, 07 Jun 2012 22:35:11 +0100 Organization: A noiseless patient Spider Message-ID: References: <0067e29b-aceb-4c50-9d62-453c4f549f2e@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="VkRmmmXzMj956AdxXtqrqg"; logging-data="30806"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19l5YqG8KBfGySZDCGLm/nFh6oU6AM6XQk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Cancel-Lock: sha1:B0eZLIRl3QZxNAzH1coJceuF4TM= sha1:85d/jC08+17nwQg8cFd+Ho4EYQc= Content-Type: text/plain; charset=us-ascii Date: 2012-06-07T22:35:11+01:00 List-Id: "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?