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,93785bd6b32ae669 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Marcus Lauster Newsgroups: comp.lang.ada Subject: Re: Programming by interface in Ada Date: Wed, 13 Aug 2008 18:08:44 +0200 Message-ID: <6ggf8iFfshhfU1@mid.individual.net> References: <7e79c4ad-d196-4372-8974-6de9b9baaea1@v39g2000pro.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net i0S+YTUL7MWo6kBlEz2pVQZb77v+cT8QDP8PBme8WOUAmbMVvs Cancel-Lock: sha1:iVwbbDHPnWaguLspmcIVMKaERKg= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <7e79c4ad-d196-4372-8974-6de9b9baaea1@v39g2000pro.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:7340 Date: 2008-08-13T18:08:44+02:00 List-Id: Adam Beneschan schrieb: > On Aug 13, 4:14 am, S�bastien Morand 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.