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 1179945753 12.201.97.213 (Wed, 23 May 2007 18:42:33 GMT) NNTP-Posting-Date: Wed, 23 May 2007 18:42:33 GMT Organization: AT&T ASP.att.net Date: Wed, 23 May 2007 18:42:33 GMT Xref: g2news1.google.com comp.lang.ada:15889 Date: 2007-05-23T18:42:33+00:00 List-Id: Randy Brukardt wrote: > > My example was: > type Roman is ('I', 'V', 'X', 'L', 'C'); > type Roman_Numeral is array (Positive range <>) of Roman; > Eight : Roman_Numeral := "VIII"; You forgot 'D' and 'M'! > "Roman" here is a character type, but there is no way to think of it as a > subtype of "Character" (for one thing, the literals have a different > ordering - 'C' > 'X', for instance). The fact that you can then use this new > type to get something that works like a String is what is interesting. It's interesting, and fun, and sometimes useful. When using it in the latter category, what's irritating is that Ada has no easy way to output Eight and other such user-defined character and string values in human-readable form. There's no equivalent of the various Text_IO pkgs for user-defined character and string types, and Enumeration_IO doesn't give you what you want. -- Jeff Carter "You couldn't catch clap in a brothel, silly English K...niggets." Monty Python & the Holy Grail 19