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-Thread: 103376,5e54ec0ce937978 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: String literals and wide_string literals - how? References: <1177063665.093083.241580@e65g2000hsc.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1177106971 12.201.97.213 (Fri, 20 Apr 2007 22:09:31 GMT) NNTP-Posting-Date: Fri, 20 Apr 2007 22:09:31 GMT Organization: AT&T ASP.att.net Date: Fri, 20 Apr 2007 22:09:31 GMT Xref: g2news1.google.com comp.lang.ada:15179 Date: 2007-04-20T22:09:31+00:00 List-Id: Robert A Duff wrote: > > type Bit is ('0', '1'); > type Bit_String is array (Positive range <>) of Bit; > pragma Pack(Bit_String); > X: constant Bit_String := "01011110"; > > Bit is a character type, and Bit_String is a string type. > > X can fit in 8 bits, by the way. for Bit'Size use 1; for Bit_String'Component_Size use Bit'Size; subtype Byte_String is Bit_String (1 .. 8); Y : constant Byte_String := "00001111"; pragma Assert (Y'Size = Y'Length); type Byte is mod 2 ** 8; for Byte'Size use 8; function To_Byte is new Ada.Unchecked_Conversion (Source => Byte_String, Target => Byte); Z : constant Byte := To_Byte (Y); What is Z and 1? -- Jeff Carter "You empty-headed animal-food-trough wiper." Monty Python & the Holy Grail 04