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,FREEMAIL_FROM, FREEMAIL_REPLY 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,UTF8 Received: by 10.204.143.145 with SMTP id v17mr1419433bku.7.1339149034226; Fri, 08 Jun 2012 02:50:34 -0700 (PDT) Path: e27ni26968bkw.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: package Ada.Tags Date: Fri, 08 Jun 2012 11:50:30 +0200 Organization: Ada @ Home Message-ID: References: <0067e29b-aceb-4c50-9d62-453c4f549f2e@googlegroups.com> NNTP-Posting-Host: O9LP5SCtbiF6KQDU04sy5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.00 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-06-08T11:50:30+02:00 List-Id: Le Thu, 07 Jun 2012 23:35:11 +0200, Simon Wright a = = =C3=A9crit: > "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 th= e >> 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 specif= ic > type to the class-wide type: > > Events_Record_Type'Class (Event)'Tag Forgive me for being pedantic, but it's important to note this is not a = = type conversion, that's a *view conversion*. -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity