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 09:23:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!199.172.62.105.MISMATCH!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: SET in Ada? Date: 14 Mar 2003 12:23:44 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <3E7203B0.B5B7E076@alfred-hilscher.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1047662624 10262 199.172.62.241 (14 Mar 2003 17:23:44 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 14 Mar 2003 17:23:44 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:35330 Date: 2003-03-14T12:23:44-05:00 List-Id: Alfred writes: > 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. The corresponding feature in Ada is a packed array of Booleans: type Bit_Set is array(...) of Boolean; pragma Pack(Bit_Set); Set: constant Bit_Set := (1 | 5 | 13 | 21 => True, others => False); if Set(I) then... - Bob