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,FREEMAIL_FROM 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!news2.google.com!news.glorb.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: String literals and wide_string literals - how? Date: Sun, 22 Apr 2007 22:18:16 +0100 Organization: Pushface Message-ID: References: <1177063665.093083.241580@e65g2000hsc.googlegroups.com> <2oPWh.9599$n_.6781@attbi_s21> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1177276700 3734 62.49.19.209 (22 Apr 2007 21:18:20 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 22 Apr 2007 21:18:20 +0000 (UTC) Cancel-Lock: sha1:RaPKuvK1te2k5wAF+wwd7npt/Y4= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (darwin) Xref: g2news1.google.com comp.lang.ada:15225 Date: 2007-04-22T22:18:16+01:00 List-Id: "Jeffrey R. Carter" writes: > Simon Wright wrote: >> >> It may not be useful but in some applications it's essential to know. >> >> And it seems to me that a compiler that thought 2#00110011# was >> acceptable probably wouldn't itself be acceptable. > > Why not? It adheres to the well defined and portable semantics Duff > mentioned. It just seems wilfully perverse, that's all. What other bizarre decisions would the designers have made? Why choose software/hardware that does that if there's a more reasonable alternative? > My point was that these kinds of arrays are promoted as a better way > to access individual bits than logical operations and shifts. But > unless you have some definition of which bit "Y (Y'First)" accesses, > they're not useful for that because they're extremely compiler > dependent, while logical operations and shifts are portable across > compilers and targets. Some sort of correspondence with the bit > numbers used in record representation clauses would be OK. I don't quite see the last sentence -- typically the bit numbering depends on the endianness, very annoying -- not sure whether new Ada sorts that one out. For the rest, I quite agree; _much_ easier to map the C condition "(x & (1<<2))" to "(X and 2#00000100#) /= 0".