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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,98ea44ae4e872928 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-14 18:12:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E728C0B.6080206@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: SET in Ada? References: <3E7203B0.B5B7E076@alfred-hilscher.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 15 Mar 2003 02:11:02 GMT NNTP-Posting-Host: 63.184.105.43 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1047694262 63.184.105.43 (Fri, 14 Mar 2003 18:11:02 PST) NNTP-Posting-Date: Fri, 14 Mar 2003 18:11:02 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:35358 Date: 2003-03-15T02:11:02+00:00 List-Id: Alfred wrote: > Hi I'm trying to convert some Modula code to Ada. There is a statement > like this: > > IF i in {1,5,13,21} THEN ... > > How could this be translated to Ada, because as far as I know, Ada has > no similar "SET" handling. You could use PragmArc.Set_Discrete from the PragmAda Reusable Components http://home.earthlink.net/~jrcarter010/pragmarc.htm In which case your example would be written as if Member (I, Make ((1, 5, 13, 21)) then However, that's a poor use of sets. If you're not defining sets and checking for membership in a set variable you probably want a case statement. -- Jeff Carter "That was the most fun I've ever had without laughing." Annie Hall