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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,887bac6875d2db34 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Access idiom Date: Mon, 21 Jan 2008 22:15:04 -0600 Organization: Jacob's private Usenet server Message-ID: References: <6j5lj.309998$Fc.80333@attbi_s21> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1200975962 21501 69.95.181.76 (22 Jan 2008 04:26:02 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 22 Jan 2008 04:26:02 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:19524 Date: 2008-01-21T22:15:04-06:00 List-Id: "Jeffrey R. Carter" wrote in message news:6j5lj.309998$Fc.80333@attbi_s21... > Gene wrote: > > > > I'm at an impasse developing a graph data structure. There are many > > node types derived from a "most general" one. Most of the node types > > contain fields that are classwide access to child nodes. Various > > primitive procedures operate on nodes, dispatching on unnamed node > > access types. In many cases, the operations return such an access > > child value. Other "identity" ops just return the dispatching > > parameter as classwide access. > > There should be no need for public access types or values in such a data > structure. Hiding them should make the package easier to use, easier to > implement, and safer. Humm, I wouldn't go quite that far. If you need to return a reference to an object (in the graph in this case) where the specific type of the object isn't known, you have to use access types unless you can afford to copy them all the time. We tried to do that with Claw, and it didn't work very well (especially with user-defined extensions). We ended up adding returning of access values in a few critical cases (like Get_Parent) in order to avoid the bad effects of copying. Summary: I wouldn't use "access" for any "in" parameters, but return values and out parameters may need to be different. Randy.