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.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,66253344eaef63db X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,66253344eaef63db X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,66253344eaef63db X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 1994-10-04 00:40:13 PST Newsgroups: comp.lang.ada,comp.object,comp.lang.c++ Path: bga.com!news.sprintlink.net!howland.reston.ans.net!cs.utexas.edu!asuvax!ennews!koehnema From: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) Subject: Re: Mut. Recurs. in Ada9X w/o Breaking Encaps.? (LONG) Message-ID: Followup-To: comp.lang.ada Sender: news@ennews.eas.asu.edu (USENET News System) Nntp-Posting-Host: enuxsa.eas.asu.edu Reply-To: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) Organization: Arizona State University References: <36eebb$jn5@disunms.epfl.ch> <1994Oct2.164105.13127@swlvx2.msd.ray.com> Date: Mon, 3 Oct 1994 20:29:00 GMT Xref: bga.com comp.lang.ada:6430 comp.object:7029 comp.lang.c++:31541 Date: 1994-10-03T20:29:00+00:00 List-Id: In article <1994Oct2.164105.13127@swlvx2.msd.ray.com> jgv@swl.msd.ray.com (John Volan) writes: > >That's my fear as well. That's why I've been trying very hard to find >an Ada9X solution. Eiffel can do decoupled mutual recursion standing on its >head. Smalltalk virtually swims in a sea of decoupled mutual recursion >(trivial in a typeless language). I suspect C++ can actually manage it as well. >(Can any C++ folks confirm this? Realize what I mean: Can you forward-declare >a class and then *not* complete its declaration in the same header file, and >yet complete the declaration of a client class? Or do you *have* to declare >both classes in the same header file?) Yes. See the example. class A; Class B { A *a; // legal ... a -> print(); // illegal }; However, the body of B cannot perform any operations on 'a' since they are not visible. I think this would also work in Ada9X, except that multiple pointer declarations would be incompatible with one another due to Ada's typing mechanism. >From what I remember of Eiffel and Smalltalk (it's been a while), one can invoke an operation from a class that has not yet been declared. However, both C++ and Ada9X require a function (or operation) be declared before it be used. I think this is the feature you seek, which is more than simply a forward declaration. Hope this helps. -- Harry Koehnemann Arizona State University hek@asu.edu Computer Science Department