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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,93785bd6b32ae669,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.k-dsl.de!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien_Morand?= Newsgroups: comp.lang.ada Subject: Programming by interface in Ada Date: Wed, 13 Aug 2008 11:14:12 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: reader.motzarella.org U2FsdGVkX193/rXi0dWZXfvhg5354EOBTJfaCEqdXZgNTG6AUmnwY0hg704RrU3sJfqvubCS9Enu9xPsVJeJnQYRuDIXKhKmIZFoRd0p4kYuR+6hBx/whmM3dDLkeOgMY8fYnqFKKRn5/xA1Nu8zXw== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Wed, 13 Aug 2008 11:14:16 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+/jD9OXzV4yNgn+dTEckTcMEJGL0OL7IAsYWyXFVOiQg== Cancel-Lock: sha1:PicSEjtqCyJdLQydbFXBClkaMuk= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) X-Enigmail-Version: 0.95.6 Xref: g2news1.google.com comp.lang.ada:1607 Date: 2008-08-13T11:14:12+00:00 List-Id: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'm trying to do the following thing: - --- pkginterface.ads ------------------------------- with ObjInterface; use ObjInterface; package PkgInterface is -- Mon interface class type MonInterface is interface; type MonInterfacePtr is access all MonInterface; procedure SetObjet(r: in out MonInterface; c: in MonCount; o: in MonObjetPtr) is abstract; end PkgInterface; - --- objinterface.ads ------------------------------- package ObjInterface is -- Mon interface class type MonObjet is interface; type MonObjetPtr is access all MonObjet; end ObjInterface; - --- pkgimpl.ads ------------------------------- with PkgInterface; use PkgInterface; with ObjInterface; use ObjInterface; package PkgImpl is type MonImpl is new MonInterface with private; type MonImplPtr is access all MonImpl; overriding procedure SetObjet(r: in out MonImpl; c: in MonCount; o: in MonObjetPtr); private type MonImpl is new MonInterface with record a: MonObjetPtr; end record; end PkgImpl; - --- pkgimpl.adb ------------------------------- package body PkgImpl is procedure SetObjet(r: in out MonImpl; c: in MonCount; o: in MonObjetPtr) is begin r.a := o; end SetObjet; end PkgImpl; - ---------------------------------- When I'm trying to compile pkgimpl.adb I get the following error: pkgimpl:5:04: (Ada 2005) : abstract interface primitives must be defined in package specs. 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, Sebastien -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) iD8DBQFIosID+zV9xm4PlDQRAnLLAJ9pHuAdVnQNrITgRZ1/RmCdGGLviwCbBggP Fy0SSIMKb5/AM03KDKaq+WA= =35KI -----END PGP SIGNATURE-----