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,6ea9f886a228469c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: pointers and genericity Date: 16 Feb 2005 10:00:12 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <344d0fee.0502150410.740d5dbd@posting.google.com> <17cfosskqxdi0$.1ux9v3kndb9kr$.dlg@40tude.net> <344d0fee.0502160127.432c8614@posting.google.com> NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1108566012 31420 69.38.147.31 (16 Feb 2005 15:00:12 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 16 Feb 2005 15:00:12 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:8354 Date: 2005-02-16T10:00:12-05:00 List-Id: xavier.serrand@free.fr (Xavier Serrand) writes: > ==============Error messages for source file: > test/test_gen_pk_user.adb > 30. U.Rec.Next := Proc_Suiv'access; > | > >>> access type must not be outside generic body If the access type is outside the generic body, then it's illegal to take 'Access of a procedure declared inside the generic body. The workaround is to declare the procedure in the generic package spec. If you don't want to export it, put it in the private part. I think the reason for this rule has something to do with making it easier to implement code sharing of generic bodies. I didn't look at your code carefully, but sometimes it's cleaner to use a tagged type with a dispatching procedure, rather than an access-to-procedure, because then you can easily package up some data with the procedure. - Bob