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: 103376,8047848c4805a99e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: matthias_k Newsgroups: comp.lang.ada Subject: Re: Classwide Parameter? Date: Mon, 11 Oct 2004 19:08:24 +0200 Organization: T-Online Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.t-online.com 1097514480 05 13963 gvHoXSn1SF9SSMLM 041011 17:08:00 X-Complaints-To: usenet-abuse@t-online.de X-ID: T5JmTcZLoeUPTxuuXuC8JrVchMaZRvDwQuChgo67S1iyREu-dZM0oM User-Agent: Mozilla Thunderbird 0.8 (X11/20040918) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5050 Date: 2004-10-11T19:08:24+02:00 List-Id: Thanks for that answer. However, I'm still having problems (I have rewritten the code to be in one single package now): package Graphics is type Shape is abstract tagged null record; procedure Draw (Obj: Shape'Class); type Circle is new Shape with record Radius: Float; Center: Float; end record; procedure Draw (Obj: Circle); type Square is new Shape with record Size: Float; end record; procedure Draw (Obj: Square); end; Now, what I want is to have different implementations of the Draw method for each Subtype. However, if I run this program: with Graphics; use Graphics; procedure Demo is type Reference is access all Shape'Class; Object: Reference; begin Object := new Circle; Draw( Object.all ); Object := new Square; Draw( Object.all ); end; The Shape's Draw method is always called here but it shouldn't. No late binding happens. I have tried to make it abstract, but it didn't even compile then. What's wrong? - Matthias