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,1e6b0935218e0d0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!newsfeed2.ip.tiscali.net!transit0.news.tiscali.nl!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Newsgroups: comp.lang.ada Subject: Re: private classes References: From: Ludovic Brenta Date: Sun, 03 Oct 2004 21:11:40 +0200 Message-ID: <87vfdrr503.fsf@insalien.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:jFKjCt8cPxArMCLPgkIdyh4SyBs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 03 Oct 2004 21:15:06 CEST NNTP-Posting-Host: 83.134.238.139 X-Trace: 1096830906 dreader2.news.tiscali.nl 44103 83.134.238.139:37727 X-Complaints-To: abuse@tiscali.nl Xref: g2news1.google.com comp.lang.ada:4622 Date: 2004-10-03T21:15:06+02:00 List-Id: "Rick Santa-Cruz" writes: > Ok, I got it. The declaration of the procedure has to be before the "type > Derived_1 is new Base_1 with private;". Although I don't understand the > sense of this, but ok ;). Dennis Lee Bieber already explained why in a previous post. I think his explanation is good and intuitive. The technical term for this is "freezing rules", defined formally in RM 13.14. You might be interested in reading that. Note that few people actually bother to really understand all the implications of freezing rules; they are of interest primarily to compiler writers. In your case, the declaration of type Derived_1 freezes type Base_1 (RM 13.14(7): "The declaration of a record extension causes freezing of the parent subtype."). After this point, no more primitive subprograms ("methods") can be added to type Base_1. This means that: - you can declare procedure Proc (B : Base_1), but it is not a primitive subprogram, just a regular one. - no dynamic dispatching can take place, since dynamic dispatching only involves primitive subprograms. -- Ludovic Brenta.