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!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!roadrunner.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: String literals and wide_string literals - how? References: <1177063665.093083.241580@e65g2000hsc.googlegroups.com> From: Keith Thompson Organization: None to speak of User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (gnu/linux) Date: Tue, 22 May 2007 19:27:59 -0700 Message-ID: Cancel-Lock: sha1:o1I0lS9d4P2KTBE43EcJiyPSHSo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rr.com Xref: g2news1.google.com comp.lang.ada:15887 Date: 2007-05-22T19:27:59-07:00 List-Id: David Thompson writes: > On Fri, 20 Apr 2007 16:02:55 -0400, Robert A Duff > wrote: >> "Randy Brukardt" writes: > >> OK, it's not weird. It's quite elegant, in fact, from at least one >> point of view -- a character type is "just" an enumeration of the >> character literals. >> >> But I'll bet it _seems_ weird to anyone who doesn't know Ada well. Are >> there any other languages that have this sort of thing? Many folks >> presented with the above will assume type Bit above is a subtype of >> Character, or derived from it. That's why I mentioned that >> Bit'Size = 1, so the OP would understand that '0' here is not Ascii (or >> Latin-1, or whatever) '0'. >> > Pascal does have CHAR as a system-provided enumerated type. > And (normal, nonvarying) STRING as (just) array of char, although it > doesn't have the features for all array types that make Ada string > types (more) convenient. [...] It's been a while, but as I recall Pascal's CHAR type isn't considered to be an enumerated type, though it is a scalar type. And a user-defined enumerated type can't have character literals as constants, only identifiers. -- Keith Thompson (The_Other_Keith) kst-u@mib.org San Diego Supercomputer Center <*> "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"