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!news2.google.com!fu-berlin.de!speedkom.net!allgaeu.org!news-mue1.dfn.de!news-fra1.dfn.de!news2.telebyte.nl!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Classwide Parameter? References: From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 12 Oct 2004 13:10:54 GMT NNTP-Posting-Host: 64.185.133.124 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1097586654 64.185.133.124 (Tue, 12 Oct 2004 06:10:54 PDT) NNTP-Posting-Date: Tue, 12 Oct 2004 06:10:54 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5126 Date: 2004-10-12T13:10:54+00:00 List-Id: matthias_k writes: > Matthew Heaney wrote: > > matthias_k writes: > > > >>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); > > Get rid of this operation. It's a "class-wide" operation (like a > > static > > method in C++), and hence the operation isn't primitive for the type > > (and therefore doesn't dispatch). > > > > Oha? I thought it would be analogous to 'virtual' in C++, not static. I should have said: "change the type from Shape'Class to Shape, and optionally declare the operation as abstract." In Ada, you don't need to say "virtual". An operation for a type is "primitive" whenever it has the type as a parameter or return type, and the operation is declared in the same package as the type. To make a "static" method in Ada, declare the parameter as T'Class. > And btw.: What does dispatch mean? :) Is that the Ada term for dynamic > binding? Yes.