From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 28 Jun 93 09:23:40 GMT From: munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!achilles!andrewd@uu net.uu.net (Andrew Dunstan) Subject: Re: Access Discrimnants Message-ID: <20mdas$ps9@huon.itd.adelaide.edu.au> List-Id: In comp.lang.ada, stt@spock.camb.inmet.com (Tucker Taft) writes: >In article <20csgf$5tr@huon.itd.adelaide.edu.au> > andrewd@achilles.cs.adelaide.edu.au (,2285592, Andrew Dunstan) writes: [ my question answered] >>thanks in advance! > >You are welcome. > Thankyou again, Tucker. As always, you provided a helpful and interesting answer to a possibly dumb question. > > type Set is limited private; > -- Abstract "Set" of Item_Type type > procedure Add_Item(To : in out Set; Item : Item_Type); > . . . > > type Set_Iterator(Over : access Set) is limited private; > -- Iterator over a given set, designated by the access discrim Given these declarations, can one say something like: function some_func(s1,s2 : set) return set is result : set; it1 : iterator(s1'access) -- or it2 : iterator(s2'unchecked_access); Of course, s1 and s2 could be copied to local aliased sets, but that would seem to be a bit of a waste if one were sure no dangling references would be created. Sigh. I'll get the hang of this soon. I just can't wait for GNAT to come out so that I can start experimenting instead of just reading and writing and asking questions! cheers andrew # Andrew Dunstan # There's nothing good or bad # # net: # # # adunstan@steptoe.adl.csa.oz.au # but thinking makes it so. # # or: andrewd@cs.adelaide.edu.au # #