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,FREEMAIL_FROM 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!postnews.google.com!not-for-mail From: xavier.serrand@free.fr (Xavier Serrand) Newsgroups: comp.lang.ada Subject: Re: pointers and genericity Date: 17 Feb 2005 14:50:09 -0800 Organization: http://groups.google.com Message-ID: <344d0fee.0502171450.2b3c3665@posting.google.com> References: <344d0fee.0502150410.740d5dbd@posting.google.com> <17cfosskqxdi0$.1ux9v3kndb9kr$.dlg@40tude.net> <344d0fee.0502160127.432c8614@posting.google.com> NNTP-Posting-Host: 82.124.169.31 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1108680610 10423 127.0.0.1 (17 Feb 2005 22:50:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Feb 2005 22:50:10 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:8396 Date: 2005-02-17T14:50:09-08:00 List-Id: thanks for that advise Bob!! in fact what i would like to do has to do with packagged data ... but i would like to implement those functionality without any objet feature... I made an "object-like" menu in c with struct and "access-to-procedure" ... somthing very poor for my TI89... and i wonder if i could make more object-like WITHOUT any object feature... Almost everything is possible with Ada 83 + very few... and i would like to proof it for my own sake... Xavier Robert A Duff wrote in message news:... > 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