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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f071b0868ee342f X-Google-Attributes: gid103376,public From: dewar@gnat.com Subject: Re: Design Question: How Best To Structure Cross-Referencing Types In Ada 95 Date: 1999/01/21 Message-ID: <787fku$k4m$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 435241213 References: <36A68FCA.E1EEAFFE@hiwaay.net> X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) X-Http-Proxy: 1.0 x16.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Jan 21 15:04:06 1999 GMT Newsgroups: comp.lang.ada Date: 1999-01-21T00:00:00+00:00 List-Id: In article <36A68FCA.E1EEAFFE@hiwaay.net>, aeg@hiwaay.net, glover@thaad.tecmasters.com wrote: > This is a multi-part message in MIME format. > --------------6448902F32C077DF069276B5 > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > Since both types and some of the subprograms reference > each other, I have to put them both in the same package. > It turns out that I have about 5 types that > behave like this and I end up with one large package. I > would rather have the types split into different > packages, but I would get circular dependencies when > compiling the specs. > > Is there a neat Ada95 way of getting around this > cross-referencing problem? This is an old and well discussed problem. Often you can introduce a third package with the types alone to at least factor this out, but the fundamental circularity problem remains and there is no solution in pure Ada 95. For JGNAT, the version of GNAT that generates code for the JVM, we have found it important to deal with this problem for the purpose of translating existing Java specs. We have therefore implemented an extension, based on Tucker's "with type" suggestion the last time around this was discussed, and this extension will be available (controlled by a switch of course) in version 3.12 of GNAT. There are not many places where one can justify out and out extensions of the language (and indeed I suppose one could do this with a pragma, but it seems silly). This however, seems an exception, where an extension is really needed. Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own