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,5697899e4423465c X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Boolean Representation Date: 1998/09/25 Message-ID: <6uen3a$f72$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 394550810 References: <6udkcj$87j$1@nnrp1.dejanews.com> <6udriu$hfi$1@nnrp1.dejanews.com> <6ue3uh$qjo$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x8.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Sep 25 00:11:22 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-09-25T00:00:00+00:00 List-Id: In article <6ue3uh$qjo$1@nnrp1.dejanews.com>, matthew_snyder@my-dejanews.com wrote: > The reason for my original question is that I'm trying to decide the best > (most portable) way to convert an UNSIGNED_8 to a record type which provides > access to the individual bits. ALWAYS ask what you really have in mind, don't abstract it to something you think is similar. An unchecked conversion of an unsigned_8 type to a packed record with 8 boolean fields most certainly is perfectly reasonable, and has nothing to do with converting a stand alone boolean to an integer as implied by your original question. Note however that it will likely be implementation dependent (e.g. endian dependent) which order the bits come out in in the resulting packed record. There is no advantage in using your own type instead of Boolean, you definitely know that when a Boolean is forced to be represented in 1 bit, then 0 is false and 1 is true. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum