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,f7611d1b6f46896b X-Google-Attributes: gid103376,public From: synoptik@home.com (A. Logue) Subject: Re: Byte-level to Bit-level Boolean Encoding Date: 2000/04/01 Message-ID: <8F08DAE4Dsynoptikdamudderfuck@news>#1/1 X-Deja-AN: 605110036 References: <8F07A24FDandrewloguecdcgycom@142.77.1.194> <20000330212836.00305.00000103@ng-fh1.aol.com> <8c3ep7$v7c$1@nnrp1.deja.com> X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.ab.home.com 954563527 24.67.75.188 (Fri, 31 Mar 2000 20:32:07 PST) Organization: @Home Network Canada User-Agent: Xnews/2.06.20 NNTP-Posting-Date: Fri, 31 Mar 2000 20:32:07 PST Newsgroups: comp.lang.ada Date: 2000-04-01T00:00:00+00:00 List-Id: robert_dewar@my-deja.com (Robert Dewar) wrote in <8c3ep7$v7c$1@nnrp1.deja.com>: >In article <20000330212836.00305.00000103@ng-fh1.aol.com>, > maggiejohn@aol.com (MaggieJohn) wrote: > >> type valid_roles is array (1..32) of boolean; >> pragma pack valid_roles; >> for valid_roles'size use 32; >> -- check the syntax here, I'm doing this from memory > >ooops, memory parity error :-) > >The syntax of the pragma is indeed incorrect of course! Nevertheless I managed to code it properly and Maggie's solution is far better than my own attempt. At least the code analyzed properly after a bit. (ran into an interesting bit of Ada trivia dealing with array constraints - I didn't know that if you constrained an array with an enumeration type, you specified the index data type as well as the size of the array. I thought it would always be array(0), array(1), etc.) As a unrelated side note, the Ada syntax for an array index has always bugged me. Pascal was my first language, so I like the [] syntax instead. This preference has been enforced by learning C/C++ and Java, and when I first started reading Ada source code, whenever I saw "array(whatever)" I kept thinking that it was procedure or function call! (as it would look without using named parameter passing.) Cheers, Andrew.