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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,53ad9e0f13a55f60 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Array Iterator Date: 1998/10/11 Message-ID: #1/1 X-Deja-AN: 399959705 Sender: matt@mheaney.ni.net References: <3620C16B.3910@erols.com> NNTP-Posting-Date: Sun, 11 Oct 1998 08:57:43 PDT Newsgroups: comp.lang.ada Date: 1998-10-11T00:00:00+00:00 List-Id: Gregory Mewborn writes: You don't have to use an ADT. You could just use an array: subtype Set_Element is Integer range 1 .. 100; type Set_Type is array (Set_Element) of Boolean; Then "set iteration" is just iteration over the array: for Element in Set_Element loop if Set (Element) then end if; end loop; Will that do? > How do i create a set iterator for a set using a boolean array. > > > I begin with: > > package integer_Set is > type Integer_Range is integer (1..100); > type set is limited private; > type set_Iteration is limited private; > > procedure start_set_Iter (S: Set); > function more (S_Iter: Set_Iteration); > Procedure next_element (S_Iter: Set_Iteration); > > > private > type Set array (Integer_RANGE) of Boolean; > > -- how do i write a Set_Iteration to use the the above functions and > procedures and to work with the Set array?