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=ham 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!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!feeder3.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Access idiom References: Date: Mon, 21 Jan 2008 02:01:12 +0100 Message-ID: <87wsq4xa93.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:FW1Zj5f6+0jdvqnt7JmMbyJmzrs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=72_DNHfT?OMa\Mo6Y1n?[C6`Y6aWje^YJl>>mocS`WZOHfAm5UI]M3@MC:f1V83;NF4GhJI9XS`RF Xref: g2news1.google.com comp.lang.ada:19493 Date: 2008-01-21T02:01:12+01:00 List-Id: Gene writes: > I tentatively have given up on access dispatching entirely, > dispatching instead on node types (not access) and copying to form > fresh values of a named classwide access type for the return > value(s). This same named type is used for node child pointers. > While this okay, there is a lot of useless copying. > > Feels like I'm playing whack-a-mole with the Ada type system. What's > the idomatic way to get this job done without the copying? Parameters of tagged types being always passed by reference (see ARM 6.3.2(5)), there is no copying involved in "dispatching on node types" as opposed to access, so I think your solution is fine. Then again, I may have misunderstood your problem. -- Ludovic Brenta.