From: xavier.serrand@free.fr (Xavier Serrand)
Subject: Re: pointers and genericity
Date: 17 Feb 2005 14:50:09 -0800
Date: 2005-02-17T14:50:09-08:00 [thread overview]
Message-ID: <344d0fee.0502171450.2b3c3665@posting.google.com> (raw)
In-Reply-To: wccsm3wo8hv.fsf@shell01.TheWorld.com
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 <bobduff@shell01.TheWorld.com> wrote in message news:<wccsm3wo8hv.fsf@shell01.TheWorld.com>...
> 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
next prev parent reply other threads:[~2005-02-17 22:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-15 12:10 pointers and genericity Xavier Serrand
2005-02-15 13:12 ` Dmitry A. Kazakov
2005-02-16 9:27 ` Xavier Serrand
2005-02-16 9:35 ` Martin Dowie
2005-02-16 9:53 ` Egil H. H�vik
2005-02-16 15:00 ` Robert A Duff
2005-02-17 22:50 ` Xavier Serrand [this message]
2005-02-17 23:11 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox