From: Marcus Lauster <marcus.lauster@gmx.de>
Subject: Re: Programming by interface in Ada
Date: Wed, 13 Aug 2008 18:08:44 +0200
Date: 2008-08-13T18:08:44+02:00 [thread overview]
Message-ID: <6ggf8iFfshhfU1@mid.individual.net> (raw)
In-Reply-To: <7e79c4ad-d196-4372-8974-6de9b9baaea1@v39g2000pro.googlegroups.com>
Adam Beneschan schrieb:
> On Aug 13, 4:14 am, S�bastien Morand <seb.mor...@gmail.com> wrote:
[...]
>> The interface primitive it's yelling about should be SetObjet which is
>> correctly defined in the spec. So waht's the matter? It looks like the
>> MonObjetPtr (access all ObjInterface) is the real problem.
>>
>> How can I achieve this?
>>
>> Thanks by advance,
>
> Well, I've found that if you change
>
> type MonObjetPtr is access all MonObjet;
>
> to
>
> type MonObjetPtr is access all MonObjet'Class;
>
> the error goes away. There is no Ada reason why this should be so. I
> think your program is legal and GNAT has a bug. Maybe it's
> incorrectly applying a rule for anonymous-access parameters to your
> MonObjetPtr parameter.
>
Maybe there is a reason. For me it seems to be ok, because an interface
is a abstract type and therefore you aren't allowed to create an object.
And as a consequence of this it seems that you also aren't allowed to
create a direct reference to it. But you can have a reference to all
objects wich are subsumed by this type.
I'm new to Ada if my toughts are going into the wrong direction correct
me please.
next prev parent reply other threads:[~2008-08-13 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 11:14 Programming by interface in Ada Sébastien Morand
2008-08-13 15:31 ` Adam Beneschan
2008-08-13 16:08 ` Marcus Lauster [this message]
2008-08-13 17:00 ` Robert A Duff
2008-08-13 17:42 ` Ludovic Brenta
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox