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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93fa00d728cc528e X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,93fa00d728cc528e X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 1994-11-03 10:40:37 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!cs.utexas.edu!convex!news.duke.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!eachus From: eachus@spectre.mitre.org (Robert I. Eachus) Newsgroups: comp.lang.ada,comp.object Subject: Re: SOLVED! Decoupled Mutual Recursion Challenger Date: 2 Nov 94 14:56:02 Organization: The Mitre Corp., Bedford, MA. Message-ID: References: <1994Oct18.221751.15457@swlvx2.msd.ray.com> <38289r$79m@oahu.cs.ucla.edu> <1994Oct19.143843.372@wdl.loral.com> <38fi4r$l81@oahu.cs.ucla.edu> <1994Oct24.174231.1897@swlvx2.msd.ray.com> <38hcv3$j85@baleen.cs.ucla.edu> <1994Oct25.155420.27353@swlvx2.msd.ray.com> <38pulp$ovg@oahu.cs.ucla.edu> <38rguj$9cd@oahu.cs.ucla.edu> NNTP-Posting-Host: spectre.mitre.org In-reply-to: jmartin@oahu.cs.ucla.edu's message of 28 Oct 1994 11:46:43 -0700 Xref: bga.com comp.lang.ada:7480 comp.object:8157 Date: 1994-11-02T14:56:02+00:00 List-Id: In article <38rguj$9cd@oahu.cs.ucla.edu> jmartin@oahu.cs.ucla.edu (Jay Martin) writes: > Could you give an example of how you could shoot yourself in the foot > using the package forward idea. How do you implement mutual recursion > using straight Ada83 derived types? The abstract type solution and > downcasting are not deemed very exceptable by many of the lang.ada > participants. Jay The representations CAN'T be mutually recursive without some variant records and other tricks. The package forward idea would allow such declarations. (There is no easy place to decide that you have such a loop.) On the other hand, even in Ada 83 it is possible to defer the actual declaration of the record object corresponding to the type to the body of the package. If you do this, you get pointer semantics for objects of the type, which may have to be adjusted in the interface, but--especially if you make the type limited--that is not a major issue. Yes, yes. If you want to have a primitive operation on Office which returns a Person and vice-versa, you can do it in one package spec, or three, or four, but not two. I still fail to understand the degree of mouth frothing directed at this "weakness" of Ada. As we have seen in the past several weeks, Ada provides lots of different ways of modeling this system. That there are some models in other languages which can be duplicated more easily than others should not come as a surprise. Let's focus on the "right" way to do it in Ada instead. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...