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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f34a46f284c01816 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Base'Class is instance of Der1? Date: Sat, 08 Jan 2005 16:00:06 +0100 Organization: None Message-ID: <5342507.zygovnidUI@linux1.krischik.com> References: <1105185677.254129.171840@c13g2000cwb.googlegroups.com> <2132851.tZm0acYkSN@linux1.krischik.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1105196695 04 29202 XtqVrYNJi6o9240 050108 15:04:55 X-Complaints-To: usenet-abuse@t-online.de X-ID: TbfWBvZarexRQDjcLogm3pa9M8EaIg949MWQsnF6kioOMZnCiQZds1 User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7569 Date: 2005-01-08T16:00:06+01:00 List-Id: Martin Dowie wrote: > Martin Krischik wrote: >> Hi R >> >> R wrote: >> >> >>>Hello. >>> >>>I've got function which has a parameter of type Base'Class. >>> >>>well I have 3 derived tagged records and depending of what exactly is >>>the parameter I have to cast it to a proper function. >> >> >> Maybe you want a view rename instead of a cast: >> >> http://en.wikibooks.org/wiki/Programming:Ada:Subtypes#Rename_View > > Surely: > > type Parent_Type is tagged null record; > type Child_Type is tagged null record; > > Child_Instance : Child_Type; > Parent_View : Parent_Type'Class renames Parent_Type'Class (Child_Type); > > Should be: > > type Parent_Type is tagged null record; > type Child_Type is new Parent_Type with null record; > > Child_Instance : Child_Type; > Parent_View : Parent_Type'Class renames Parent_Type'Class > (Child_Instance); Ups, you are right! But why did you not hit the [edit] button and corrected it? Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com