comp.lang.ada
 help / color / mirror / Atom feed
From: "RasikaSrinivasan@gmail.com" <RasikaSrinivasan@gmail.com>
Subject: Re: package Ada.Tags
Date: Thu, 7 Jun 2012 14:48:20 -0700 (PDT)
Date: 2012-06-07T14:48:20-07:00	[thread overview]
Message-ID: <3a03daff-725c-4455-b447-e4e5412b4d51@googlegroups.com> (raw)
In-Reply-To: <m2mx4elsa8.fsf@pushface.org>

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" <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?




  reply	other threads:[~2012-06-07 21:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 20:36 package Ada.Tags RasikaSrinivasan
2012-06-07 21:35 ` Simon Wright
2012-06-07 21:48   ` RasikaSrinivasan [this message]
2012-06-08  9:50   ` Yannick Duchêne (Hibou57)
2012-06-08  9:59     ` Dmitry A. Kazakov
2012-06-08 15:26     ` Adam Beneschan
2012-06-08 16:31     ` Simon Wright
2012-06-07 21:49 ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox