comp.lang.ada
 help / color / mirror / Atom feed
From: munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!achilles!andrewd@uu net.uu.net  (Andrew Dunstan)
Subject: Re: Access Discrimnants
Date: 28 Jun 93 09:23:40 GMT	[thread overview]
Message-ID: <20mdas$ps9@huon.itd.adelaide.edu.au> (raw)

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   #                                 #

             reply	other threads:[~1993-06-28  9:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-28  9:23 munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!achilles!andrewd [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-06-28 10:12 Access Discrimnants munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!achilles!andrewd
1993-06-30 15:23 Tucker Taft
1993-07-01 13:28 munnari.oz.au!metro!basser.cs.su.oz.au!news.adelaide.edu.au!achilles!andr
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox