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-Language: ENGLISH,ASCII X-Google-Thread: 103376,12527b153c400dab,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-29 23:05:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!jussieu.fr!news.edf.fr!not-for-mail From: Vincent DIEMUNSCH <"vincent.diemunsch"@edf.fr@NO.SPAM.PLEASE> Newsgroups: comp.lang.ada Subject: Tagged types (beginner's question) ! Date: Thu, 29 Aug 2002 11:39:47 +0200 Organization: EDF Message-ID: NNTP-Posting-Host: cnn00007.cnen.de.edf.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: clnews.edf.fr 1030613988 20890 144.165.69.7 (29 Aug 2002 09:39:48 GMT) X-Complaints-To: newsadm@news.edf.fr NNTP-Posting-Date: 29 Aug 2002 09:39:48 GMT X-Mailer: Mozilla 4.5 [fr] (WinNT; I) X-Accept-Language: fr Xref: archiver1.google.com comp.lang.ada:28585 Date: 2002-08-29T09:39:48+00:00 List-Id: Hello, I have a simple question concerning tagged types. Suppose that we have : type Rationnel is abstract new Ada.Finalization.Controlled with null record; type Fraction is new Rationnel with record Num�rateur : integer; D�nominateur : positive; end record; type Entier is new Fraction with null record; First Question : Can I override the primitive operation "Adjust" of the controlled type with the following : procedure Adjust (F : in out Fraction'Class); instead of : procedure Adjust( F : in out Fraction); Second question : How can Adjust (F : in out Fraction'Class) return an object of type Entier instead of Fraction ? I tried something like F := E; --(with E : Entier) and many other more complicated things but I always have the same error message from GNAT : "Dynamiclly tagged expression required". Looking in the ARM and the user guide from GNAT, I could not get what this message meant ! Any help would be greatly appreciated. Thanks in advance. Vincent DIEMUNSCH